← Lessons

quiz vs the machine

Platinum1720

Machine Learning

The Generator And Discriminator

Examine the roles, signals, and gradient flow that make the two GAN networks improve.

5 min read · advanced · beat Platinum to climb

The Generator And Discriminator

The two networks inside a GAN have opposite goals but share a single signal. Understanding how that signal flows explains how each one learns.

The generator

  • Takes a random noise vector and maps it through layers into a sample shaped like real data.
  • It never sees real data directly. Its only feedback is how the discriminator rates its fakes.
  • Its gradient comes from the discriminator. When the discriminator labels a fake as fake, that error pushes the generator to make it more convincing.

The discriminator

  • Acts as a binary classifier scoring each input as real or fake.
  • It learns from labeled examples, real ones marked real and generated ones marked fake.
  • Its gradient sharpens its ability to detect subtle artifacts in fakes.

How they co adapt

  • Early on the discriminator wins easily and gives strong gradients.
  • As the generator improves, the discriminator job gets harder, which keeps the learning signal flowing.
  • If either side becomes too strong, the other receives weak gradients and learning stalls.

Key idea

The generator turns noise into samples using only the discriminator gradient as feedback, while the discriminator learns to detect fakes, and balanced strength keeps both networks improving.

Check yourself

Answer to earn rating on the learn ladder.

1. What feedback does the generator learn from?

2. What happens if one network becomes far stronger than the other?