What is a generative adversarial network?
A generative adversarial network sets up a contest between two networks. The generator turns random noise into synthetic samples, and the discriminator judges whether a sample is real or generated. As the discriminator gets better at spotting fakes, the generator is pushed to make more convincing ones, and this adversarial loop continues until the generated data is hard to distinguish from real data.
GANs produce samples in a single forward pass, which makes generation fast, though the adversarial training can be delicate to balance.
Key takeaways
- A GAN pairs a generator against a discriminator in competition.
- The generator improves as the discriminator learns to catch fakes.
- Sampling is fast, but training can be unstable.
How it works
The generator maps random noise to a sample, and the discriminator outputs the probability that a given sample is real. The two are trained together with opposing objectives, the generator trying to fool the discriminator and the discriminator trying not to be fooled. At convergence the generator captures the data distribution well enough that the discriminator can no longer tell the difference reliably.
Why it matters
GANs were a breakthrough in realistic data generation and remain useful for fast synthesis, data augmentation, and image editing. Understanding them also clarifies the trade-offs that led many applications toward diffusion models, which often trade speed for higher quality and more stable training.
Frequently asked questions
Why is GAN training unstable?
The generator and discriminator must improve in balance. If one overpowers the other, learning stalls or collapses, which makes GANs sensitive to tuning.
How do GANs differ from diffusion models?
GANs generate in one pass and are fast, while diffusion models generate over many denoising steps and usually achieve higher quality and diversity.
Related terms