ddpm_cifar(pretrained: bool | str = False, weights: DDPMCifarWeights | None = None, overrides: object = {})Construct a DDPM U-Net trunk for the CIFAR-10 setup.
Paper-faithful CIFAR-10 configuration from Ho, Jain, and Abbeel, 2020
Appendix B.1 / Table 9: sample size 32x32, base_channels=128,
channel_mult=(1, 2, 2, 2) (four spatial stages — 32 -> 16 -> 8 ->
4), 2 ResBlocks per stage, self-attention at the 16x16 feature map,
1 attention head, dropout 0.1, and a 1000-step linear beta
schedule.
Model Size
Parameters
pretrainedbool or str= FalseWeight selector.
False → random init; True → the official
google/ddpm-cifar10-32 checkpoint
(DDPMCifarWeights.CIFAR10) — the trained noise predictor
.weights(DDPMCifarWeights, optional, keyword - only)= NoneExplicit weights enum member; takes precedence over
pretrained.**overridesobject= {}Optional
DDPMConfig field overrides (e.g. dropout=...,
num_train_timesteps=...) forwarded into the underlying config.
Overrides that change the U-Net shape are incompatible with the
pretrained checkpoint.Returns
DDPMModelBare U-Net trunk configured with the CIFAR-10 setup (pretrained when requested).
Notes
Reference: Ho, Jain, and Abbeel, "Denoising Diffusion Probabilistic Models", NeurIPS, 2020 (arXiv:2006.11239), Appendix B.1.
Examples
>>> import lucid
>>> from lucid.models.generative.ddpm import ddpm_cifar
>>> model = ddpm_cifar().eval()
>>> x_t = lucid.randn((1, 3, 32, 32))
>>> t = lucid.tensor([42]).long()
>>> out = model(x_t, t)
>>> out.sample.shape # (1, 3, 32, 32) — predicted noise
(1, 3, 32, 32)