Unit 5 of 7 · about 5 hours · derive

Diffusion: forward corruption, reverse denoising and prediction targets

Diffusion training is ELBO arithmetic plus one Gaussian closure. Once the closed form and the noise-to-data map are routine, schedules and samplers become cost choices.

You'll be able to

  • Derive the one-step forward kernel, the closed-form -to- sampler and the reverse conditional used for training.
  • Derive the diffusion ELBO down to the per-step noise matching loss of Algorithm 18.1.
  • Recognize noise, data and velocity prediction targets and state when each stays stable.

Covers

Diffusion forward corruption and reverse denoisingNoise, data and velocity prediction recognition
1

Read

In this order, only the parts listed

0 of 3 done

  1. Forward encoder and closed-form samplingUnderstanding Deep Learning - generative models

    Sections 18.1 and 18.2 with Equations 18.1 to 18.8 and Figures 18.2 and 18.3 (pp. 349 to 353)

  2. Reverse decoder, ELBO and the noise reparameterizationUnderstanding Deep Learning - generative models

    Sections 18.3 to 18.5 with Equations 18.16 to 18.40 and Algorithm 18.1 (pp. 356 to 363)

  3. Velocity parameterizationProgressive Distillation for Fast Sampling of Diffusion Models

    Section 4: the definition with , and the low signal-to-noise stability argument

    Read only the parameterization and loss-weighting discussion. Leave Algorithms 1 and 2 and all distillation results for later.

2

Focus on

  • The forward kernel is (Eq 18.2). Products of Gaussians close in closed form: with the product of (Eqs 18.7 and 18.8).
  • The reverse conditional (Eq 18.15) trains the decoder. The ELBO (Eq 18.25) becomes per-step KL terms that reduce to squared error between the true reverse mean and (Eqs 18.28 and 18.29).
  • Section 18.5 converts data prediction into noise prediction through Eq 18.30 and trains to output with the plain loss of Eq 18.40. The map is linear, so the two targets carry the same information with different conditioning.
  • Velocity keeps the implied prediction stable when signal-to-noise goes to zero, where -to- division by blows up. UDL never names it, so the paper supplies this one recognition item.
Common mistakes · 3
  • Scaling the mean by instead of . The square root is what keeps the variance at 1 when the input has unit variance (Problem 18.1); without it the signal shrinks faster than the noise is added.
  • Indexing at instead of in the reverse mean. The coefficient in Eq 18.28 is sensitive to this shift; test separately.
  • Treating noise, data and velocity targets as different models. They parameterize the same reverse mean; only their numerical behavior at low signal-to-noise differs.
3

Try it yourself

Closed-book, before checking anything

Closed-book, derive the three-step closed form of Problem 18.3 from Equations 18.5 to 18.7, then verify with NumPy that at with on linspace(0.1,0.2,5) gives [1.1057,1.3488].
4

Quiz yourself

Answer first, then mark it. Missed ones go to Review.

0 got · 0 missed

  1. 1.Write the one-step forward kernel and the direct -to- sampler.Answer

    . Then with the product of over to .

  2. 2.With a linear schedule linspace(0.1,0.2,5), what is for x0=[1.0] and eps=[1.0]?Answer

    [1.2649]. is 0.9, so .

  3. 3.How are noise prediction and data prediction related?Answer

    By (Eqs 18.30 and 18.31). UDL trains to predict (Eqs 18.35 to 18.40); the data estimate follows by this linear map.

  4. 4.State the velocity target and why it helps.Answer

    with . It stays well scaled at zero signal-to-noise, where converting an prediction to divides by near zero.

5

Practice

  • UDL Problems 18.1 to 18.3: variance preservation and the closed form

    Problems 18.1 to 18.3 (pp. 372 to 373): covariance preservation, combining two noises, and the three-step expansion to Eq 18.45

    Do all three on paper, then check the [1.2649] and [1.1057,1.3488] numbers with NumPy. These are the forward-process facts every sampler assumes.

You're done when

You derive Eq 18.8 without notes, both numeric checks match to 4 decimals, and you can convert a noise output into data and velocity forms.

Only when you can do this without notes.

Leads to

Notes

Resources · 2 for this unit, 3 more in the section
  • Understanding Deep Learning - generative modelsSimon J. D. Prince · primary

    Read Chapter 14 for evaluation limits, 15 for GANs, 17 for VAE and ELBO, and 18 for diffusion. Read Chapter 16 only for flow recognition. Use notebooks 17.1-17.3 and 18.1-18.4 as mathematical and visual practice.

  • Progressive Distillation for Fast Sampling of Diffusion ModelsarXiv · reference

    Read Section 4 only for the velocity parameterization and why it stays stable at zero signal-to-noise ratio. Leave Algorithms 1 and 2 and the distillation results for later.

Also in this section

  • D2L - GAN and DCGAND2L authors · support

    Use gan.md and dcgan.md for one bounded adversarial exposure. The required implementation remains a small VAE with separate reconstruction and KL terms on a two-dimensional mixture or binarized MNIST subset.

  • Deep-ML candidate - VAE, GAN and diffusion problemsDeep-ML · optional

    After the platform admission check, use at most one of 393 VAE Loss, 1384 Reparameterization, 174 1D GAN or 303 Forward Diffusion as a changed-prompt drill.

  • Stanford CS231n - diffusion assignment sliceStanford University · optional

    Use the Assignment 3 diffusion component only after the VAE gate if diffusion mechanics remain weak. It is not a second required generative implementation.