ScoreSDEConfig
GenerativeModelConfigScoreSDEConfig(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""ve" is NCSN's continuous
limit, "vp" is DDPM's, "subvp" is the one this paper
introduces.sigma_minfloat= 0.01, 50.0sigma_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.0sigma_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.0beta_maxfloat= 0.1, 20.0num_scalesint= 1000snrfloat= 0.16corrector_stepsint= 10 makes the sampler
predictor-only.base_channels...= 128channel_mult...= 128num_res_blocks...= 128attention_resolutions...= 128num_heads...= 4dropout...= 4resnet_groups...= 4Notes
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
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
Constructors
1__init__
→None__init__(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)