liveBook · Manning

Sequence-to-sequence learning

As explained in Deep Learning with R, Third Edition

Sequence-to-sequence learning is the prediction of an output sequence from an input sequence, potentially with different lengths or representations.

Sequence-to-sequence learning predicts an output sequence from an input sequence, even when their lengths or representations differ. It supports tasks such as translating paragraphs or answering questions. section 20.1.6

A sequence-to-sequence Transformer uses two coordinated components:

  • A TransformerEncoder converts the input vector sequence into representations that capture context and order. section 20.1.6
  • A TransformerDecoder receives the encoded sequence and target sequence, then predicts what should come next. section 20.1.6

Machine translation

Map a source-language paragraph to a target-language paragraph with an encoder-decoder Transformer; question answering is another stated use. section 20.1.6

Table 20.1 Model architectures for different data types
Input
Output
Model
Vector data
Class probability, regression value
Densely connected network
Timeseries data
Class probability, regression value
RNN, Transformer
Images
Class probability, regression value
Convnet
Text
Class probability, regression value
Transformer
Text, images
Text
Transformer
Text, images
Images
VAE, diffusion model

Use the architecture table to compare Transformers with RNNs and other model families across input and output types. section 20.1.6

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains the encoder-decoder architecture and its prediction roles without deriving attention or detailing training procedures.
Examples
Uses paragraph translation and question answering as concrete sequence-to-sequence examples.
What you can do after
Builds sequence-to-sequence Transformer designs with Keras TransformerEncoder and TransformerDecoder layers.
How it connects
Connects Transformers to neural attention, positional encoding, RNNs, 1D convolutional networks, machine translation, and question answering.

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.