← Lessons

quiz vs the machine

Platinum1820

Machine Learning

Generative Adversarial Networks

Two networks compete, a generator faking data and a discriminator catching fakes.

6 min read · advanced · beat Platinum to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. What is the discriminator's job?

2. What is mode collapse?