What it is
A generative adversarial network trains two networks in a contest. A generator tries to produce data that looks real, and a discriminator tries to tell real data from generated data.
The adversarial game
The two networks improve by competing.
- The generator takes random noise and outputs a sample, such as an image
- The discriminator scores each sample as real or fake
- The generator is rewarded when it fools the discriminator, and the discriminator is rewarded when it is not fooled
As training proceeds, the generator makes ever more convincing samples and the discriminator gets sharper. At the ideal point the generator output is indistinguishable from real data.
Why it is tricky
This minimax game is powerful but unstable.
- Mode collapse happens when the generator produces only a few outputs that reliably fool the discriminator
- Training can fail to converge if one network overpowers the other
- Careful loss design and balancing the two networks help keep the game stable
Key idea
A generative adversarial network pits a generator against a discriminator so the generator learns to produce realistic data.