Interactive Lab · Generative Adversarial 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
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
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