In a GAN, both the generator and discriminator need to be trained. What we don’t want to do is to train one of these elements, first using all the training data, and then train the other afterwards. We want the generator and discriminator to both learn together without one getting too far ahead of the other.

Steps for training

The following 3 step training loop is one way to do this:

  • Step 1 - Show the discriminator a real data example, tell it the classification output should be 1.0.

  • Step 2 - Show the discriminator the output of the generator, tell it the classification output should be 0.0.

  • Step 3 - Show the discriminator the output of the generator, tell the generator the result should be 1.0.

This is the heart of most GAN training schemes.

Step 1: Training the discriminator with real images

Let’s draw some pictures to show what these steps actually mean.

Get hands-on with 1200+ tech skills courses.