NCSN
7 memberslucid.models.generative.ncsnNCSN family — Song & Ermon, 2019 (score-based generative models).
Song, Yang, and Stefano Ermon. "Generative Modeling by Estimating Gradients of the Data Distribution." NeurIPS, 2019.
NCSN — Noise-Conditional Score Network — is the score-based counterpart of DDPM. Rather than predicting noise inside a discrete Markov chain, it directly learns the (Stein) score function , where is the data distribution convolved with Gaussian noise of standard deviation .
Training uses denoising score matching (Vincent 2011): for a noised sample , the conditional score is available in closed form, , giving the loss
with the standard weighting so every noise level contributes comparable magnitude. The architecture reuses the same U-Net as DDPM but conditions on (continuous) rather than a discrete timestep .
The key innovation is noise annealing: a geometric schedule (defaults , , ) where the largest smooths the data distribution enough that low-density regions become traversable, then sampling refines toward where the score approximates that of clean data. Sampling uses annealed Langevin dynamics — for each level in order, run steps of
with the per-level step size (Song 2019, §4.3) — large early on, decaying as noise shrinks. The score-based view unifies with diffusion through the continuous SDE framework (Song et al., 2021), where DDPM and NCSN become different discretisations of the same reverse-time process.
Classes
Functions
ncsn_celeba→ NCSNModelConstruct an NCSN score network for the CelebA 64x64 setup.
ncsn_celeba_gen→ NCSNForImageGenerationConstruct an NCSN CelebA 64x64 model with DSM loss and .generate().
ncsn_cifar→ NCSNModelConstruct an NCSN score network for the CIFAR-10 setup.
ncsn_cifar_gen→ NCSNForImageGenerationConstruct an NCSN CIFAR-10 model with DSM loss and .generate().