Cheatsheet: Teaching machines to imagine
The one idea that matters
Section titled “The one idea that matters”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.
Discriminative vs generative
Section titled “Discriminative vs generative”| Discriminative | Generative | |
|---|---|---|
| Learns | the boundary between groups | the shape of the data itself |
| Job | given an input, output a label | produce a new example |
| Example | ”cat or dog?“ | draw a new cat |
| Every prior lesson’s networks | yes | no (until now) |
The VAE (variational autoencoder)
Section titled “The VAE (variational autoencoder)”- 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.
The GAN (generative adversarial network)
Section titled “The GAN (generative adversarial network)”- 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.
Two routes, one destination
Section titled “Two routes, one destination”| VAE | GAN | |
|---|---|---|
| Mechanism | sample from a learned, organized space | generator-vs-discriminator contest |
| Tends toward | plausible, sometimes blurry | sharp, sometimes unstable to train |
(A newer route, diffusion, powers many modern image generators, next lesson.)
Pitfalls to dodge
Section titled “Pitfalls to dodge”- “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.
Words to use precisely
Section titled “Words to use precisely”- 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.
The one-line version
Section titled “The one-line version”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.