Training controls
⚠ Low diversity — the generator collapses onto very few modes of the real distribution (mode collapse).
Metrics
Epoch
0
Generator loss
—
Discriminator accuracy
—
Real data pdata Generated G(z)
How it works

A GAN pits two networks against each other: a generator G that maps latent noise z to fake samples G(z), and a discriminator D that tries to tell real samples x apart from fakes. Training is a minimax game:

min_G max_D V(D,G) = E[log D(x)] + E[log(1 − D(G(z)))]
                     x~p_data              z~p_z

The cyan curve is a stand-in for the real-data manifold pdata (here a 2D lemniscate). The red-to-green dots are generated samples G(z); every frame each one steps (scaled by the learning rate) toward its assigned target on the curve, the same way a generator improves from the discriminator's gradient feedback. Dot colour doubles as an implicit discriminator score — red means D can still flag the sample as fake, green means it now looks real.

  • Generator learning rate — the fraction of the remaining distance to the target each step covers; too high causes oscillation, too low means slow convergence.
  • Latent diversity — how many distinct manifold points the generator's outputs are allowed to target. Near 0 forces most of the batch onto a handful of modes — the classic GAN failure called mode collapse.
  • Batch size — how many latent samples z are drawn and generated per step.

Generator loss is the mean distance from generated points to their targets (falls as training proceeds); discriminator accuracy estimates how easily D still separates real from fake — near a Nash equilibrium it settles close to 50%, a coin flip.