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.