hvae_gen(pretrained: bool = False, overrides: object = {})Construct a hierarchical VAE with the ELBO loss and prior-sample .generate().
Same trunk as hvae (3-level latent stack, 3-stage encoder),
wrapped with the hierarchical ELBO training loss (reconstruction +
sum of per-level -weighted KLs) and a convenience prior
sampler that draws one
per level.
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
VAEConfig field overrides forwarded into the
underlying config.Returns
VAEForImageGenerationHierarchical VAE wrapped with ELBO loss and prior sampler.
Notes
Reference: Sønderby, Raiko, Maaløe, Sønderby, and Winther, "Ladder Variational Autoencoders", NeurIPS, 2016 (arXiv:1602.02282).
Examples
>>> import lucid
>>> from lucid.models.generative.vae import hvae_gen
>>> model = hvae_gen().eval()
>>> x = lucid.randn((1, 3, 32, 32))
>>> out = model(x)
>>> out.sample.shape, out.kl_loss.shape
((1, 3, 32, 32), ())