Song and Ermon (2019) generate samples from a score network with annealed Langevin dynamics: run Langevin updates at a large noise level, then re-use the result as the starting point for the next, smaller noise level, down to .
annealed_langevin(score_fn, sigmas, eps, T, x_init, rng, decimals=4)
score_fn(x, sigma) returns the score of the data perturbed with Gaussian noise of standard deviation sigma, as an array with the shape of x.sigmas is a decreasing 1-D array ; eps is the base step size ; T the number of updates per level.x_init has shape (N, d) (the chains); do not modify it in place. rng is a np.random.Generator.taking from a single call rng.standard_normal(x.shape) once per update, in this order so results are reproducible.
"samples" (the final (N, d) array, unrounded), "mean" and "std" (the mean and population standard deviation over the chains for each coordinate, as lists rounded to decimals).T updates.x.std(axis=0) is the population standard deviation by default.standard_normal draw per update; any extra call changes the stream.