Construct the NICE flow for the MNIST setup.
Paper-faithful MNIST configuration from Dinh et al., 2014 Figure 3: 784 dimensions, four additive coupling layers whose coupling networks have five hidden layers of 1000 rectified units, an odd/even input partition, and a standard logistic prior.
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
NICEConfig field overrides forwarded into the
underlying config.Returns
NICEModelBare bijection configured with the MNIST setup and any overrides.
Notes
Reference: Dinh, Krueger, and Bengio, "NICE: Non-linear Independent
Components Estimation", ICLR Workshop, 2015 (arXiv:1410.8516),
Figure 3. Reported test log-likelihood: 1980.50 nats, on data
dequantised with uniform 1/256 noise and rescaled to
(no whitening for MNIST).
Examples
>>> import lucid
>>> from lucid.models.generative.nice import nice_mnist
>>> model = nice_mnist(input_dim=64, hidden_dim=16).eval()
>>> x = lucid.rand((1, 64))
>>> h, log_det = model.encode(x)
>>> h.shape, log_det.shape
((1, 64), (1,))