GAN: Learning a data distribution through a minimax game
GANs train a noise-to-sample generator against a real/fake discriminator. The paper derives the optimal discriminator and a JS-divergence equilibrium, while practice uses a non-saturating generator loss.
On this page
A generative adversarial network learns a samplable implicit distribution without an explicit density. G maps noise to data space and D distinguishes data from generated samples.
How it works
The value combines log D(x) on data and log(1-D(G(z))) on generated samples. For fixed G, D*=p_data/(p_data+p_g), leading to a JS-divergence interpretation and equilibrium at p_g=p_data, D=1/2.
What the evidence shows
Experiments on MNIST, TFD and CIFAR-10 show samples and nearest-neighbor checks. Their scale is modest; the lasting contribution is the framework and theory rather than modern image fidelity.
A reproducible check
This snippet checks a public formula or configuration; it does not reproduce full training.
pd, pg = 0.7, 0.3
d = pd/(pd+pg)
js = 0.5*(pd*__import__('math').log2(2*pd/(pd+pg)) + pg*__import__('math').log2(2*pg/(pd+pg)))
print("optimal D(x) =", d)
print("JS divergence =", js)
optimal D(x) = 0.7
JS divergence = 0.05935455038465365
The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.
Limitations and common misreadings
Training can oscillate or collapse modes, and a strong discriminator weakens the original generator gradient. The paper therefore uses a non-saturating alternative; attractive samples do not prove full coverage.
The key takeaway
GANs turn density estimation into a two-player game: the equilibrium is elegant, while optimization remains difficult.
Further reading
FAQ
- What do the two networks do?
- The generator maps noise to samples; the discriminator estimates whether samples are real.
- What is the ideal equilibrium?
- Generated and data distributions match, and the discriminator outputs one half.
- Why are GANs difficult to train?
- Adversarial optimization can oscillate or collapse modes, and early generator gradients can vanish.