GAN Lab 🧠⚡

A real neural network running in your browser. No APIs. No shortcuts. Pure math.

TRAINING DATA

📁
Drop images here
or click to browse
0/20 images (need 3+)

Images are downscaled to 12×12 grayscale so the neural network can learn in your browser.

NETWORK ARCHITECTURE

LOSS CURVES

Generator
Discriminator
Epoch: 0 | Iterations: 0

OUTPUT

Train the network and generate samples to see output here.

CONSOLE

HYPERPARAMS

0.02
16
48
4
12

⚠ Changing params resets the network. Larger values = slower training.

TRAINING

Epoch: 0
Iterations: 0
G Loss: —
D Loss: —

GANs pit two neural networks against each other:

🎨 The Generator is like an art forger — it creates fake images from random noise, trying to fool the Discriminator.

🔍 The Discriminator is like a detective — it tries to tell real images from fakes.

They make each other better through pure spite. The Generator gets better at forging, the Discriminator gets better at detecting.

Under the hood: This implements real backpropagation with gradient descent. Forward passes compute activations through layers of weights. Backward passes compute how to adjust each weight to reduce loss.

The images are tiny (12×12 pixels) because running neural networks in JavaScript is... ambitious. But it genuinely learns patterns!

💡 Tip: Upload similar images (e.g., simple shapes, letters) for best results. This is a real neural net — not a filter or trick.