liveBook · Manning

Real vs fake

As explained in Inside Deep Learning: Math, Algorithms, Models

The two target classes used in GAN classification, representing genuine data and generated data.

Real and fake are the two target classes in GAN classification. Real labels identify samples from the training data; fake labels identify outputs produced by the generator. The discriminator learns to distinguish these classes, while the generator tries to make fake samples receive the real label. section 9.1 section 9.1.1

Use the classes differently for each network:

  • Compute discriminator loss for real data with yreal and for generated data with yfake. section 9.1.1
  • Compute generator loss only from generated data, swapping in yreal because successful generation fools the discriminator. section 9.1.1
  • Alternate updates to the discriminator and generator as their predictions and objectives change. section 9.1.2
Figure 9.3 Diagram of how GANs are generally trained. The generator G learns to assign meaning to random values z to produce meaningful outputs . The discriminator receives real and fake data but doesn’t know which—and tries to learn the difference in a standard classification problem. Then G’s loss is computed on D’s output but is the inverse. G gets an error when D does not, and G gets no error when D does.

Use the training diagram to trace how real and fake samples flow through the discriminator and how the generator receives the inverse objective. section 9.1

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Explains class targets through discriminator and generator losses, then connects them to alternating training updates.
Examples
Uses training-data samples, generator outputs, swapped labels, and evolving discriminator predictions as examples.
What it assumes
Assumes familiarity with classification loss and introduces GAN roles, target classes, and latent-vector-generated data.
What you can do after
Apply real and fake targets when computing discriminator and generator losses during GAN training.
How it connects
Connects binary classification with GANs, generators, discriminators, latent vectors, and loss functions.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.