liveBook · Manning

VQ-VAE decoder

As explained in Build a Text-to-Image Generator (from Scratch)

A VQ-VAE decoder is the image-reconstruction component that maps quantized latent codes or their codebook vectors back to an image.

A VQ-VAE decoder reconstructs an image from quantized latent codes: it uses each integer code to retrieve its codebook embedding, then maps the resulting vectors back into image space. section 11.3.2

The decoding path proceeds in three stages:

  • Receive a sequence of discrete integer codes produced by quantization. section 11.3.2
  • Retrieve the corresponding embeddings from the codebook. section 11.3.2
  • Reconstruct the image from those retrieved latent vectors. section 11.3.2

Decoding a cat image

A quantized cat image may become 576 codes such as (873, 862, …, 148). Feeding the sequence to the decoder retrieves the indexed embeddings and reconstructs the cat image. section 11.3.2

Figure 11.5 The architecture of a VQ-VAE and its three components—encoder, codebook, and decoder—in the training process

Use the architecture figure to trace how the encoder, codebook, and decoder participate in VQ-VAE processing. section 11.3.2

How Build a Text-to-Image Generator (from Scratch) covers it

How deep it goes
Traces integer codes through codebook lookup to image reconstruction without specifying layer-level decoder implementation.
Examples
Uses a cat image represented by 576 codes, including indices 873, 862, and 148.
What you can do after
Apply a pretrained VQ-VAE decoder to convert generated image-token sequences into images.
How it connects
Connects quantization, codebook embeddings, discrete tokens, VQ-VAE, transformers, and DALL-E.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Text-to-Image Generator (from Scratch). The section links point to the parts of the book it draws on.