liveBook · Manning

Encoder-decoder architecture

As explained in Learn Generative AI with PyTorch

An encoder-decoder architecture is a neural model design in which an encoder transforms input into a representation and a decoder uses that representation to produce output, often mapping one sequence to another.

An encoder-decoder architecture has two parts: the encoder turns input into a compact or abstract representation, and the decoder uses that representation to produce or reconstruct output. section 7.0

The same pattern supports different tasks:

  • In an autoencoder, the encoder compresses an image into a latent representation and the decoder reconstructs it; one example maps 784-pixel handwritten digits to 20-value vectors. section 7.0
  • In machine translation, the encoder represents an English phrase and the decoder constructs a French translation. section 7.0
  • Text-to-image Transformers can encode an image into a compact, low-dimensional probability distribution and decode from it. section 7.0

The representation and the work performed by each part vary across models. In an autoencoder, reconstruction error is a central training objective; the architecture also appears in variational autoencoders and Transformers. section 7.0

How Learn Generative AI with PyTorch covers it

How deep it goes
Defines encoding and decoding through latent representations and reconstruction, without detailing architecture internals.
Examples
Uses handwritten-digit reconstruction, English-to-French translation, and image encoding in text-to-image Transformers as examples.
What you can do after
Build an autoencoder from scratch to encode handwritten digits into 20-value vectors and reconstruct their images.
How it connects
Connects autoencoders and variational autoencoders with GANs and Transformers.

Also explained in

Compare how 14 books explain encoder-decoder architecture →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Learn Generative AI with PyTorch. The section links point to the parts of the book it draws on.