Construct an NCSN score network for the CIFAR-10 setup.
Paper-faithful CIFAR-10 configuration combining Song and Ermon, 2019
§4.1 with the NCSNv2 (Song 2020) Table 1 refinements: sample size
32x32, base_channels=128, channel_mult=(1, 2, 2, 2), 2
ResBlocks per stage, self-attention at the 16x16 feature map,
geometric noise levels in , and the NCSNv2 §3.3 Langevin schedule
( steps per level, ).
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
NCSNConfig field overrides forwarded into the
underlying config.Returns
NCSNModelScore network configured with the CIFAR-10 setup and any overrides.
Notes
Reference: Song and Ermon, "Generative Modeling by Estimating Gradients of the Data Distribution", NeurIPS, 2019 (arXiv:1907.05600); NCSNv2 refinements in Song and Ermon, 2020 (arXiv:2006.09011).
Examples
>>> import lucid
>>> from lucid.models.generative.ncsn import ncsn_cifar
>>> model = ncsn_cifar().eval()
>>> x_tilde = lucid.randn((1, 3, 32, 32))
>>> sigma_idx = lucid.tensor([3]).long()
>>> out = model(x_tilde, sigma_idx)
>>> out.sample.shape # (1, 3, 32, 32) — raw score
(1, 3, 32, 32)