Construct a hierarchical (Ladder-style) VAE with one latent per stage.
Hierarchical VAE topology following Sønderby et al., 2016, configured
with a 32x32 input, down_block_channels=(64, 128, 256) (three
stride-2 encoder stages), and per-stage latent widths
(32, 64, 128) — one extracted per
stage and re-injected at the matching decoder resolution. The KL
becomes a sum over levels (independent-posterior Ladder variant).
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
VAEConfig field overrides forwarded into the
underlying config. The tuple latent_dim must match the
length of down_block_channels.Returns
VAEModelHierarchical VAE trunk configured with the 3-level default and any overrides.
Notes
Reference: Sønderby, Raiko, Maaløe, Sønderby, and Winther, "Ladder Variational Autoencoders", NeurIPS, 2016 (arXiv:1602.02282).
Hierarchical ELBO:
Examples
>>> import lucid
>>> from lucid.models.generative.vae import hvae
>>> model = hvae().eval()
>>> x = lucid.randn((1, 3, 32, 32))
>>> out = model(x)
>>> out.sample.shape, out.latent.shape # latent is flat concat (32+64+128)
((1, 3, 32, 32), (1, 224))