Interactive Lab · Generative Adversarial Networks

A forgery game between two networks

A Generator starts as a hopeless forger, it turns random noise into scattered dots. A Discriminator is the detective, trying to tell those fakes from the real data. Train them against each other and something remarkable happens: to fool a sharpening detective, the forger is forced to learn the real distribution exactly. Press Train and watch the orange fakes snap onto the blue ring.

▶ The playground, watch the forger learn

step 0 D loss G loss coverage status untrained
real data generated (fake)
Target distribution what the forger must learn to reproduce
ring 8 blobs
0.0005 · slowfast/unstable · 0.01
8 · weak forgerstrong · 40
1 · balanced5 · detective dominates
1 · a single dialrich · 8

🧭 Where this fits

GANs pit a generator against a critic so a model learns to synthesize realistic data from noise. They drove the first wave of photorealistic faces, image editing, and super-resolution. Diffusion often replaces them now, but the adversarial idea, a learned critic as the loss, shows up everywhere, including how models get evaluated.

The code that's actually running



  

🔮 Predict, then test

Switch the target to 8 blobs and train. The forger has to cover all eight, a much harder ask. Watch whether it spreads to every blob or piles onto just a few. Piling onto a few is mode collapse, the classic GAN failure: the forger finds one spot that fools the detective and stops exploring. The tricks in this demo (a non-saturating generator loss, balanced training) are exactly what keep it honest, try shoving detective steps to 5 or the learning rate to max and see if you can break it.

The takeaway

Your new mental model of GANs