liveBook · Manning

Discriminator

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

A discriminator is a neural-network component that distinguishes generated samples from samples drawn from the target data distribution.

A discriminator is a neural-network component that receives real training samples and generated samples, then classifies each as real or fake. In a GAN, it improves its classification while the generator learns to fool it; successful generation drives its accuracy toward approximately 50%. section 11.4.1

In VQGAN, the discriminator contributes to perceptual image quality through three linked roles:

  • Evaluates reconstructed or generated images against real images from the target distribution. section 11.4.2
  • Supplies adversarial pressure that encourages decoded images to appear perceptually realistic, complementing reconstruction and quantization losses. section 11.4.2
  • Works with a VQ-VAE generator whose encoder, codebook, and decoder produce images from discrete latent codes. section 11.4.2

Real versus decoded images

During VQGAN training, the discriminator compares an image from the training set with an image decoded from quantized latent codes, learning to distinguish them while adversarial training pushes the reconstruction toward perceptual realism. section 11.4.2

Figure 11.6 VQGAN architecture and training process in which VQGAN combines a VQ-VAE generator with a discriminator in a GAN framework
A diagram of a fish

AI-generated content may be incorrect.

Trace the VQGAN architecture and training process connecting the VQ-VAE generator, discrete codebook, decoder, and discriminator. section 11.4.2

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

How deep it goes
Defines inputs, classification, minimax competition, and VQGAN integration without detailing internal discriminator architecture.
Examples
Uses real training images, generated samples, and VQ-VAE reconstructions as real-versus-fake classification cases.
What you can do after
Evaluate how adversarial classification improves perceptual realism in GAN and VQGAN image generation.
How it connects
Connects GANs, generators, VQ-VAEs, codebooks, adversarial loss, reconstruction loss, quantization loss, and perceptual loss.

Also explained in

Compare how 8 books explain discriminator →

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.