Diffusion Models

Week 15 · December 1, 2026

generative
The forward noising process, learning to denoise, sampling, and conditional generation.
Author

Harun Pirim

Reading Prince, Understanding Deep Learning, Chapter 18

These notes are still being written. The reading above is authoritative until this banner disappears.

1 Learning Objectives

By the end of this week you should be able to:

  1. Describe the forward diffusion process and its closed-form marginal at any timestep.
  2. Explain the reparameterization that lets a network predict noise instead of the clean image.
  3. Write the training objective for a denoising diffusion probabilistic model.
  4. Describe ancestral sampling and the speed/quality trade-off of the sampler.
  5. Explain classifier-free guidance and conditional generation.
  6. Relate diffusion models to score matching and to VAEs.
Plotting setup (click to expand)
import numpy as np
import matplotlib.pyplot as plt
import torch

torch.manual_seed(774)
np.random.seed(774)

plt.rcParams.update({
    "figure.figsize": (7, 4),
    "figure.dpi": 130,
    "axes.spines.top": False,
    "axes.spines.right": False,
    "axes.grid": True,
    "grid.alpha": 0.25,
    "font.size": 10,
    "legend.frameon": False,
})

NDSU_GREEN = "#005643"
NDSU_GOLD  = "#FFC72C"
ACCENT     = "#C1121F"

2 The Forward Process

TODO

3 Closed Form at Arbitrary Timesteps

TODO

4 The Reverse Process

TODO

5 The Training Objective

TODO

6 Sampling

TODO

7 Conditional Generation and Guidance

TODO

8 Connections to Score Matching

TODO

9 A Minimal Diffusion Model in PyTorch

TODO

10 Summary

TODO


11 Exercises

Problem numbers refer to Prince, Chapter 18.

1. TODO

2. TODO

3. Computational. TODO


12 Further Reading

  • Prince, Understanding Deep Learning, Chapter 18.
  • TODO
Back to top