Generative Adversarial Networks (GANs)
A forger versus a detective
A GAN pits two networks against each other. The generator is a forger: it turns random noise into fake data and tries to pass it off as real. The discriminator is a detective: it sees real and fake examples and tries to tell them apart. As the detective gets sharper, the forger is forced to get better — until the fakes are indistinguishable from reality.
Maps a random vector to a sample, trained to fool the discriminator.
A binary classifier trained to catch the generator's fakes.
One's gain is the other's loss. They improve together until equilibrium.
Watch the arms race
Early on the fakes are obvious and the detective wins easily. As training proceeds, the fake data distribution slides toward the real one — and the discriminator's accuracy collapses toward a coin flip.
Powerful, but tricky
- Famously sharp, realistic images
- Fast one-shot generation (no iterative denoising)
- Great for faces, style transfer, super-resolution
- Unstable training — the two can oscillate
- Mode collapse: generator outputs the same few samples
- Hard to know when it has "converged"
GANs dominated image generation for years. Today diffusion models often beat them on quality and stability — but GANs remain prized when generation speed matters. Both are alternatives to the VAE for generative modelling.