The data have three classes, the arms of a spiral. One network g(z, w, t, c) was trained with the class replaced by a null value 20% of the time, so it predicts the noise both for p(x | c) and for p(x). Guidance (20.60) samples with the score λ∇ln p(x|c) + (1 − λ)∇ln p(x), that is with the noise prediction λg(c) + (1 − λ)g(∅): λ = 0 ignores the class, λ = 1 is the plain conditional model, λ > 1 pushes samples to where the class is unmistakable. Near the centre the noisy arms overlap, so strong guidance empties the inner end of the arm and narrows the spread.
Classifier guidance (20.59) adds λ∇ln p(c | zt) to the unconditional score; here the noisy classifier is exact (the data density is a Gaussian mixture), and then (20.58) makes it identical to the exact version of (20.60). Agreement is the mean of p(c | x) under the exact clean classifier; spread is the square root of the trace of the sample covariance. The red curve in the lower panel is the distance from the centre under the density p(x|c)λp(x)1−λ, normalised on a grid.
code/ch20_diffusion_models.py (make_eps_fn, classifier_grad, tilted_radius_density, guidance_metrics, Figure 20.7 and supplementary Figure 20.S8); with the same seed the points here equal demo_sample. Weights: data/ch20-denoiser.json.