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
