realnvp_cifar(pretrained: bool = False, overrides: object = {})Construct the RealNVP flow for the CIFAR-10 setup.
Paper-faithful CIFAR-10 configuration from Dinh et al., 2016 §4.1:
32 x 32 RGB, coupling networks of 8 residual blocks with 64
feature maps, and — unlike every other experiment — only a single
downscale, so the flow keeps working at 16 x 16 rather than
recursing to 4 x 4.
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
RealNVPConfig field overrides forwarded into
the underlying config.Returns
RealNVPModelBare bijection configured with the CIFAR-10 setup and any overrides.
Notes
Reference: Dinh, Sohl-Dickstein, and Bengio, "Density Estimation
Using Real NVP", ICLR, 2017 (arXiv:1605.08803), §4.1 and Table 1.
Reported test result: 3.49 bits/dim, with horizontal-flip
augmentation and the alpha = 0.05 logit preprocessing this model
applies internally.
Examples
>>> import lucid
>>> from lucid.models.generative.realnvp import realnvp_cifar
>>> model = realnvp_cifar().eval()
>>> x = lucid.rand((1, 3, 32, 32))
>>> model.bits_per_dim(x).shape
(1,)