Generative Models & Diffusion
Track 19 · Advanced
VAEs, GANs, and diffusion: how AI generates images and more.
15 lessons 4.6 hours narrated Free, no account needed
The 3 phases, lesson by lesson
Phase 1 Generative foundations
- What a generative model is: the four paradigms A generative model learns a distribution well enough to sample new data. Defines what generative means and maps the four paradigms behind modern AI systems.
- Autoregressive models and the chain rule How autoregressive models use the chain rule to factor a joint distribution into conditionals, then train by next-token negative log-likelihood.
- Maximum likelihood and the KL view Why maximum likelihood is exactly minimizing the forward KL divergence from data to model, and why autoregressive, flow, and VAE training share this objective.
- Normalizing flows: change of variables A normalizing flow models a distribution exactly via an invertible transform. Learn the change-of-variables formula and Jacobian determinant rescaling density.
Phase 2 Latent and adversarial
- Latent variables and the ELBO Derive the evidence lower bound (ELBO) via Jensen's inequality, split it into reconstruction and KL terms, and verify the gap identity on a binary example.
- VAE training: the reparameterization trick How variational autoencoders become trainable: the reparameterization trick makes the ELBO differentiable, and a closed-form Gaussian KL gives a cheap loss.
- GANs, the minimax game How GANs train by a minimax game between a generator and a discriminator, why the implicit divergence is Jensen-Shannon, and why mode collapse is built in.
- WGAN-GP: Wasserstein loss, gradient penalty Swap the GAN's Jensen-Shannon divergence for the Wasserstein distance and enforce the 1-Lipschitz critic with a gradient penalty for stable WGAN-GP training.
- Evaluating generative models How to compare VAEs, GANs, and diffusion models when likelihood isn't universal: FID, Inception Score, precision and recall, and human preference studies.
Phase 3 Energy, score, diffusion
- Energy-based models, the partition problem An energy-based model uses a free energy function over an intractable partition function. Why that blocks maximum likelihood, and the score-function escape.
- Score matching and score-based generation Score matching estimates the score directly, no partition function; denoising score matching reduces it to a noise-prediction loss that sets up diffusion.
- Diffusion models I: forward and reverse processes How diffusion models work: a fixed forward chain noises data into Gaussian, a learned reverse chain denoises back, and the DDPM training and sampling loops.
- Diffusion models II, training and sampling What made diffusion practical: DDIM (a deterministic sampler that needs far fewer steps), classifier-free guidance, and the latency-quality Pareto frontier.
- Score-based diffusion via SDEs, the unifying view The continuous-time SDE that unifies score matching, DDPM, and DDIM, shows the noise predictor is the score function, and yields a deterministic ODE sampler.
- The four-paradigm landscape of generative AI Map the four generative-AI paradigms (autoregressive, latent-variable, adversarial, diffusion) by training objective, sampling, and trade-offs to place systems.