AI in Motion

Generative Adversarial Networks (GANs)

Deep LearningIntermediate1:266 chapters

A forger and a detective train together. Watch the generator’s fake distribution move until it matches real data.

📄 Illustrated notes · every chapter as a picture · printable

Shortcuts: Space play/pause · ←/→ 5 s · N/P chapter · M voice · C subtitles · F fullscreen

Quick quiz

3 questions to check your understanding.

Q1 What does the discriminator output?
Q2 What is mode collapse?
Q3 At the ideal end of training, the discriminator’s output is about…

Go deeper

University-level written lectures in The AI Lecture Hall:

Transcript

Introduction. In 2014, Ian Goodfellow and colleagues proposed a clever game between two neural networks. It led to strikingly realistic generated faces and images. These are GANs.

Two players. The generator is a forger. It turns random noise into fake samples. The discriminator is a detective. It looks at real and fake samples and tries to tell them apart. Each network trains to beat the other.

The training game. Here the green curve is real data. The pink curve is what the generator produces. At first its fakes are obviously wrong, and the discriminator, the dashed line, easily separates them. Round by round, the generator improves until its distribution matches the real one, and the discriminator can only guess: about fifty-fifty.

The loop. Each round: sample noise, generate fakes, update the discriminator to tell real from fake, then update the generator to fool the updated discriminator. Repeat thousands of times.

Strengths and challenges. GANs generate sharp images in a single pass. But training can be unstable, and they can suffer mode collapse, producing little variety. For text to image generation, diffusion models have largely taken over.

Recap. To recap. The generator creates fakes, the discriminator judges them, and competition drives both to improve, until the fakes match reality.