The score: a gradient of log-density
The topic DDPM: reverse process and objective trained a network to predict the noise mixed into , then generated images by calling it times. It ended with a claim still to be checked. Without the network cannot know which noise was added, so it learns the average — and that average was said to be, up to a scale and a sign, the gradient of the log-density of noisy images. Why does that make noise prediction work so well? This topic builds the object behind the claim and then checks it.
The score of a density is
It is a vector field. At every point it returns a vector of the same size as , pointing where grows fastest. On a slope it is long and points uphill; at a peak it is zero. A score model is therefore a network from to , the same shape as a denoiser.
The derivative is taken with respect to the data , not the parameters. The score-function estimator in The reparameterization trick differentiated with respect to parameters; here the parameters stay fixed and the point moves.
The simplest case is a 1-D Gaussian. Its log-density (see Multivariate Gaussians) is a parabola in :
Its derivative in is the score of a Gaussian. The checks below ask you to take it.