Skip to content
data

ScoreSDEConfig

extendsGenerativeModelConfig
ScoreSDEConfig(sample_size: int | tuple[int, int] = 32, in_channels: int = 3, out_channels: int = 3, act_fn: GenerativeActivation = 'silu', sde_type: str = 'vp', sigma_min: float = 0.01, sigma_max: float = 50.0, beta_min: float = 0.1, beta_max: float = 20.0, num_scales: int = 1000, snr: float = 0.16, corrector_steps: int = 1, base_channels: int = 128, channel_mult: tuple[int, ...] = (1, 2, 2, 2), num_res_blocks: int = 2, attention_resolutions: tuple[int, ...] = (lambda: (16,))(), num_heads: int = 4, dropout: float = 0.1, resnet_groups: int = 32)

Frozen configuration for the Score-SDE family.

Parameters

sde_type(vp, ve, subvp)= "vp"
Which of the three processes. "ve" is NCSN's continuous limit, "vp" is DDPM's, "subvp" is the one this paper introduces.
sigma_minfloat= 0.01, 50.0
VE's geometric noise range. sigma_min is the paper's fixed 0.01; sigma_max is chosen per dataset and 50 is its CIFAR-10 value.
sigma_maxfloat= 0.01, 50.0
VE's geometric noise range. sigma_min is the paper's fixed 0.01; sigma_max is chosen per dataset and 50 is its CIFAR-10 value.
beta_minfloat= 0.1, 20.0
VP and sub-VP's linear rate range, set by the paper "to match the settings in Ho et al. (2020)".
beta_maxfloat= 0.1, 20.0
VP and sub-VP's linear rate range, set by the paper "to match the settings in Ho et al. (2020)".
num_scalesint= 1000
Steps a discrete sampler takes. The continuous model does not depend on it — it is a property of the sampler, and the whole point of the framework is that it can be changed after training.
snrfloat= 0.16
Signal-to-noise ratio of the Langevin corrector step.
corrector_stepsint= 1
Langevin steps per predictor step. 0 makes the sampler predictor-only.
base_channels...= 128
The U-Net, forwarded to the DDPM U-Net.
channel_mult...= 128
The U-Net, forwarded to the DDPM U-Net.
num_res_blocks...= 128
The U-Net, forwarded to the DDPM U-Net.
attention_resolutions...= 128
The U-Net, forwarded to the DDPM U-Net.
num_heads...= 4
As above.
dropout...= 4
As above.
resnet_groups...= 4
As above.

Notes

Reference: Song, Sohl-Dickstein, Kingma, Kumar, Ermon, and Poole, "Score-Based Generative Modeling through Stochastic Differential Equations", ICLR, 2021 (arXiv:2011.13456).

The network is DDPM's U-Net. The paper's NCSN++ and DDPM++ are that architecture plus a set of separately-ablated modifications — FIR up/downsampling, rescaled skip connections, progressive growing, and doubled depth for the "deep" rows of its Table 3. None of those are implemented here, so a configuration in this family is the paper's SDE machinery over the backbone this zoo already ships, and the reported FID numbers do not transfer. The SDEs, the samplers and the objective are the paper's; the backbone is not.

Continuous time reaches the U-Net through the discrete embedding. The DDPM U-Net conditions on an integer timestep, so a continuous t∈[0,1]t \in [0, 1] is scaled by num_scales - 1 before it is handed over — which is what the reference implementation does for its continuous VP models.

Examples

>>> from lucid.models.generative.score_sde import ScoreSDEConfig
>>> cfg = ScoreSDEConfig()
>>> cfg.sde_type, cfg.beta_min, cfg.beta_max
('vp', 0.1, 20.0)

Used by 3