Skip to main content
Interactive 3D/GAN Training Dynamics
Round 0
GAN Training
Generator vs Discriminator - 1D Gaussian target.
Hyperparameters
Learning rate0.0020
1e-41e-2
D steps / round1
More D steps → stronger discriminator
Actions
HUD
G loss2.0000
D loss2.0000
D(real)0.500
D(fake)0.500
Round0
G mean0.000
How It Works
The Generator transforms noise into samples. The Discriminator scores real vs fake.

At equilibrium: D(x) = 0.5 everywhere, D_loss ≈ ln(2) ≈ 0.693. Generator's distribution matches the real one.

More D steps = stronger discriminator signal, but can destabilize the generator.

GAN Training Dynamics - Interactive Visualization

A GAN trains two networks in opposition: a generator that creates fake samples to fool the discriminator, and a discriminator that tries to distinguish real from fake. The generator gets better by receiving gradients from the discriminator's mistakes. The theoretical equilibrium is a Nash equilibrium where generated samples are indistinguishable from real ones - but training is notoriously unstable and prone to mode collapse.

  • Watch generator and discriminator loss curves evolve - a healthy GAN shows discriminator loss near 0.693 (log 2) at equilibrium
  • See mode collapse in action: the generator discovers a small region the discriminator cannot distinguish and stops exploring
  • Understand the minimax objective: generator minimizes log(1-D(G(z))), discriminator maximizes log(D(x)) + log(1-D(G(z)))
  • Learn Wasserstein distance (WGAN): a more stable training objective that measures true distributional distance
  • Compare real data distribution vs generated distribution after 10, 100, and 1000 training steps

Part of the EngineersOfAI Interactive 3D - free interactive visualizations covering every major concept in machine learning and AI engineering. Hover any element for a plain-English explanation. No code required.