Generative Modeling by Estimating Gradients of the Data Distribution
(1907.05600v3)
Published 12 Jul 2019 in cs.LG and stat.ML
Abstract: We introduce a new generative model where samples are produced via Langevin dynamics using gradients of the data distribution estimated with score matching. Because gradients can be ill-defined and hard to estimate when the data resides on low-dimensional manifolds, we perturb the data with different levels of Gaussian noise, and jointly estimate the corresponding scores, i.e., the vector fields of gradients of the perturbed data distribution for all noise levels. For sampling, we propose an annealed Langevin dynamics where we use gradients corresponding to gradually decreasing noise levels as the sampling process gets closer to the data manifold. Our framework allows flexible model architectures, requires no sampling during training or the use of adversarial methods, and provides a learning objective that can be used for principled model comparisons. Our models produce samples comparable to GANs on MNIST, CelebA and CIFAR-10 datasets, achieving a new state-of-the-art inception score of 8.87 on CIFAR-10. Additionally, we demonstrate that our models learn effective representations via image inpainting experiments.
The paper introduces a novel generative model using annealed Langevin dynamics and score matching to estimate data distribution gradients efficiently.
The approach trains a single noise conditional score network to simultaneously learn scores over multiple noise levels for robust sampling.
Empirical results on CIFAR-10 achieve an inception score of 8.87 and a competitive FID of 25.32, demonstrating the model's practical effectiveness.
The paper introduces a novel generative modeling framework leveraging Langevin dynamics with score matching for estimating gradients of the data distribution. The method addresses challenges related to data residing on low-dimensional manifolds by perturbing the data with Gaussian noise at varying levels and jointly estimating the corresponding scores. The authors propose an annealed Langevin dynamics approach, utilizing gradients corresponding to gradually decreasing noise levels as the sampling process converges to the data manifold.
The key components of the work include:
A new generative model based on Langevin dynamics and score matching.
Score estimation is performed using a neural network trained with score matching to learn the vector field from data.
An annealed version of Langevin dynamics is introduced, starting with scores corresponding to the highest noise level and gradually annealing down the noise level.
Score-based generative modeling involves two main steps: score matching and Langevin dynamics.
Score Matching: The score of a probability density p(x) is defined as ∇xlogp(x). Score matching trains a score network sθ(x) to estimate ∇xlogpdata(x). The objective function is:
Epdata(x)[tr(∇xsθ(x))+21∥sθ(x)∥22],
where ∇xsθ(x) denotes the Jacobian of sθ(x).
Denoising Score Matching: A variant of score matching that perturbs the data point x with a pre-specified noise distribution qσ(x~∣x) and then employs score matching to estimate the score of the perturbed data distribution. The objective is:
Sliced Score Matching: Sliced score matching uses random projections to approximate tr(∇xsθ(x)) in score matching. The objective is
$\qquad \mathbb{E}_{p_v} \mathbb{E}_{p_\text{data}\bigg[v^\intercal \nabla_x s_\theta(x) v + \frac{1}{2} \|s_\theta(x)\|_2^2 \bigg],$
where pv is a simple distribution of random vectors, e.g, the multivariate standard normal.
Langevin Dynamics: Langevin dynamics produces samples from a probability density p(x) using only the score function ∇xlogp(x). Given a fixed step size ϵ>0, the Langevin method recursively computes:
x~t=x~t−1+2ϵ∇xlogp(x~t−1)+ϵzt,
where zt∼N(0,I).
To address the challenges of score-based generative modeling, specifically the manifold hypothesis and the presence of low data density regions, the authors propose Noise Conditional Score Networks (NCSN)
Noise Conditional Score Networks (NCSN): The data is perturbed using various levels of noise, and scores corresponding to all noise levels are simultaneously estimated by training a single conditional score network. The noise levels are chosen such that σ1 is large enough to mitigate the difficulties and σL is small enough to minimize the effect on data.
Learning NCSNs via Score Matching: Both sliced and denoising score matching can train NCSNs. The denoising score matching objective for a given σ is:
This is combined for all σ∈{σi}i=1L to get a unified objective.
L(θ;{σi}i=1L)≜L1i=1∑Lλ(σi)ℓ(θ;σi).
The coefficient function is chosen as λ(σ)=σ2.
NCSN inference via annealed Langevin dynamics: After training the NCSN sθ(x,σ), annealed Langevin dynamics is used to generate samples. The sampling approach starts by initializing samples from a fixed prior distribution and then running Langevin dynamics to sample from qσ1(x) with step size α1. Subsequently, Langevin dynamics are run to sample from qσ2(x), starting from the final samples of the previous simulation with a reduced step size α2. This process continues until qσL(x) is sampled, which is close to pdata(x) when σL≈0.
The authors present image generation results on MNIST, CelebA, and CIFAR-10 datasets. On CIFAR-10, the model achieves a state-of-the-art inception score of 8.87 for unconditional generative models and a competitive FID score of 25.32. Additionally, they demonstrate the model's ability to learn effective representations via image inpainting experiments.