Skip to content
fn

realnvp_cifar_gen

→RealNVPForImageGeneration
realnvp_cifar_gen(pretrained: bool = False, overrides: object = {})

RealNVP generator for CIFAR-10 (bits/dim loss + .generate()).

Same bijection as realnvp_cifar, wrapped with the paper's training objective — exact negative log-likelihood reported in bits per dimension — and single-pass ancestral sampling.

Model Size

Parameters

pretrainedbool= False
No checkpoint is published for realnvp_cifar_gen, so True raises NotImplementedError rather than return randomly initialised weights.
**overridesobject= {}
Optional RealNVPConfig field overrides forwarded into the underlying config.

Returns

RealNVPForImageGeneration

Generator configured with the CIFAR-10 setup.

Notes

Reference: Dinh, Sohl-Dickstein, and Bengio, "Density Estimation Using Real NVP", ICLR, 2017 (arXiv:1605.08803). Reported: 3.49 bits/dim.

Examples

>>> from lucid.models.generative.realnvp import realnvp_cifar_gen
>>> model = realnvp_cifar_gen().eval()
>>> model.generate(n_samples=2).samples.shape
(2, 3, 32, 32)

Used by 1