vae_gen(pretrained: bool = False, overrides: object = {})Construct a vanilla VAE with the ELBO loss and prior-sample .generate().
Same trunk as vae (single 128-dim bottleneck, 3-stage encoder),
wrapped with the ELBO training loss (reconstruction +
-weighted KL) and a convenience prior sampler.
Model Size
Parameters
pretrainedbool= FalseReserved for future weight registration; currently a no-op.
**overridesobject= {}Optional
VAEConfig field overrides forwarded into the
underlying config. Pass kl_weight=... to engage
-VAE behaviour; pass recon_loss="bce" for
Bernoulli likelihoods.Returns
VAEForImageGenerationVanilla VAE wrapped with ELBO loss and prior sampler.
Notes
Reference: Kingma and Welling, "Auto-Encoding Variational Bayes", ICLR, 2014 (arXiv:1312.6114).
Examples
>>> import lucid
>>> from lucid.models.generative.vae import vae_gen
>>> model = vae_gen().eval()
>>> x = lucid.randn((1, 3, 32, 32))
>>> out = model(x)
>>> out.sample.shape, out.kl_loss.shape # reconstruction + scalar KL
((1, 3, 32, 32), ())