How a model learns to make new data. The course starts with latent variable models and the evidence lower bound, then covers the reparameterisation trick that trains a VAE, the adversarial game of a GAN, the exact likelihood of a normalising flow, and the forward and reverse processes of a diffusion model.
01
A latent variable model makes data from a hidden code. The likelihood is an integral with no closed form, so a VAE maximises a lower bound on it: reconstruction quality minus a KL penalty.
02
Write a sample as mu + sigma * eps with independent noise eps. Then the sample is a smooth function of mu and sigma, and gradients can flow through it.
03
A generator tries to fool a discriminator, and the discriminator tries to tell real data from fake. Both losses are binary cross-entropy, and the non-saturating generator loss keeps early gradients useful.
Practise it
04
An invertible map from data to a simple base distribution gives an exact log likelihood through the change of variables formula. Coupling layers keep the Jacobian triangular, so its determinant is cheap.
05
A diffusion model adds Gaussian noise to the data over many small steps until only noise is left. A closed form gives the noisy sample at any step directly from the clean one.
06
A network learns to predict the noise in a noisy sample. Sampling starts from pure noise and removes a little predicted noise at each step, with some fresh noise added back.
Practise it