🎭

Generative Adversarial Networks Advanced

Two networks in a contest: a generator invents samples, a discriminator judges them. Visualise both and the realness score.

3 lessons 9 quiz questions ⚡ Live compiler
Lessons & quizzes Compiler Certificate

📚 Lessons & quizzes

Each lesson ends with its own short quiz. Answer them as you go — score 90% across all lessons to earn your certificate.

1 A forger versus a detective

A Generative Adversarial Network trains two networks against each other: the generator turns random noise into samples, and the discriminator tries to tell real from fake. Change the noise below and watch a sample get generated and scored.

2 The adversarial game

The two play a minimax game: the discriminator maximises its accuracy while the generator minimises it by producing ever more convincing fakes. At the ideal equilibrium the generator’s samples are indistinguishable from real data and the discriminator outputs ≈0.5.

const sigmoid = x => 1 / (1 + Math.exp(-x));
// discriminator score for a sample value
function discriminate(x, w, b) { return sigmoid(w * x + b); }
console.log(discriminate(0.3, 2.0, -0.5)); // probability the sample is 'real'

3 Power, pitfalls and uses

GANs produce strikingly realistic images, art, super-resolution and data augmentation. They can be tricky to train: mode collapse (the generator makes only a few outputs) and unstable dynamics are common challenges addressed by variants like DCGAN, WGAN and StyleGAN.

⚡ Generative Adversarial Networks Compiler

Code runs live in a sandboxed frame, rendered by your browser.

JS

            

🎓 Certificate of Completion

🔒 Complete every lesson quiz above with 90%+ to unlock your downloadable certificate.