Skip to content
← All PyTorch tracks

Generative Models

PyTorch

From autoencoders through VAEs to modern diffusion. The math behind generating images, audio, and text.

11 exercises

Explore freely. Sign in to keep your progress.

Your learning sequence

  1. 1 Not solved yet. Autoencoder Practice · Medium
  2. 2 Not solved yet. Simple GAN Generator Practice · Hard
  3. 3 Not solved yet. VAE Reparameterization Trick Practice · Easy
  4. 4 Not solved yet. VAE ELBO Loss Practice · Medium
  5. 5 Not solved yet. DDPM Noise Schedule Practice · Easy
  6. 6 Not solved yet. DDPM Forward Noising Practice · Medium
  7. 7 Not solved yet. DDPM Denoising Step Practice · Hard
  8. 8 Not solved yet. Classifier-Free Guidance Practice · Medium
  9. 9 Not solved yet. Train VAE End-to-End Practice · Medium
  10. 10 Not solved yet. DDPM Training Step End-to-End Practice · Medium
  11. 11 Not solved yet. DDPM Sampler Loop Practice · Hard

Check yourself

4 questions · not saved while you're signed out

Use these questions to check your understanding and compare explanations. Your score does not affect track completion.

0 / 4 correct

Why can a decoder mean trained with pixel-wise squared error look blurry when its conditioning information leaves several sharp outputs plausible?

Choose one answer to reveal the explanations. Answers are kept only while this page is open.

import torch

# Two equally likely two-pixel targets for the same conditioning information.
targets = torch.tensor([[1., 0.], [0., 1.]])
mean_prediction = targets.mean(dim=0)
for name, prediction in [("one target", targets[0]),
                         ("mean", mean_prediction)]:
    error = (targets - prediction).square().mean()
    print(name, f"MSE={error.item():.2f}")
Question 1 of 4