Skip to content
class

SubVPSDE

extendsVPSDE
SubVPSDE(beta_min: float = 0.1, beta_max: float = 20.0)

Sub-VP — the SDE this paper introduces, and its best likelihoods.

Parameters

beta_minfloat= 0.1
The linear rate range. The paper's values, "to match the settings in Ho et al. (2020)".
beta_maxfloat= 0.1
The linear rate range. The paper's values, "to match the settings in Ho et al. (2020)".

Notes

Song et al. (2021), equation 12:

dx=−12β(t)x dt+β(t)(1−e−2∫0tβ(s)ds)  dw.dx = -\tfrac{1}{2}\beta(t)x\,dt + \sqrt{\beta(t)\big(1 - e^{-2\int_0^t\beta(s)ds}\big)}\; dw.

Same drift as VP, a diffusion damped by how far the process has already travelled. "The variance of the stochastic process induced by Eq. (12) is always bounded by the VP SDE at every intermediate time step", which is why the name and why the paper reports its best bits-per-dimension here.

The perturbation kernel differs from VP's in exactly one place — equation 29 gives [1 - e^{-∫β}]^2 where VP has 1 - e^{-∫β} — so the standard deviation is that quantity rather than its square root. Getting that wrong leaves a model that still trains.

Examples

>>> from lucid.models.generative.score_sde._sde import SubVPSDE
>>> sde = SubVPSDE(beta_min=0.1, beta_max=20.0)
>>> sde.prior_variance
1.0
The same terminal variance as VP with a smaller one along the way,
which is what the "sub" refers to — it reports better likelihoods at
the same endpoints.

Used by 1

Instance methods

2
fn

diffusion

→Tensor
diffusion(t: Tensor)

Equation 12's damped coefficient.

fn

marginal_prob

→tuple[Tensor, Tensor]
marginal_prob(x: Tensor, t: Tensor)

Equation 29's sub-VP row — note the square, not a square root.