Skip to content

Cheatsheet: Teaching machines to imagine

discriminative model = a JUDGE (input → label; learns the boundary between groups)
generative model = a MAKER (learns what the data looks like → produces new examples)

Same neural-network engine, opposite direction.

DiscriminativeGenerative
Learnsthe boundary between groupsthe shape of the data itself
Jobgiven an input, output a labelproduce a new example
Example”cat or dog?“draw a new cat
Every prior lesson’s networksyesno (until now)
  • Autoencoder: hourglass network, squeeze an image into a short latent code, then rebuild it. The narrow middle forces it to keep only the essence.
  • Variational twist: train that latent space to be smooth and well-organized (no holes).
  • Generate: pick a new point in the latent space, decode it → a new, plausible example. Slide between two points → one face morphs into another.
  • Characteristic: plausible, sometimes slightly blurry.
  • Two networks in a contest: generator makes fakes; discriminator (a classifier) tells fake from real.
  • Counterfeiter vs detective: each round, the catcher sharpens and the faker improves.
  • The contest IS the training; the generator never sees real images, only the discriminator’s verdicts.
  • Characteristic: sharp, convincing; training is finicky to balance.
VAEGAN
Mechanismsample from a learned, organized spacegenerator-vs-discriminator contest
Tends towardplausible, sometimes blurrysharp, sometimes unstable to train

(A newer route, diffusion, powers many modern image generators, next lesson.)

  • “Generative means it understands/imagines.” No. It learned the statistical shape of its data and samples from it.
  • “Tell the type by output polish.” No, tell by the job: judgment (discriminative) vs new example (generative).
  • “VAE and GAN are the same.” Same goal, different methods (organized space vs contest).
  • “The GAN generator studies real images.” No, it learns only from the discriminator’s verdicts on its fakes.
  • Discriminative: learns the boundary between groups; outputs a label.
  • Generative: learns the data distribution; outputs new examples.
  • Latent code / space: the compact representation a VAE compresses data into and samples from.
  • Generator / discriminator: the faker and the catcher in a GAN’s training contest.

Every network before this was a judge; a generative model is a maker, learning the shape of its world well enough to produce new pieces of it.