All projects Generative Models

Variational Autoencoder

Amortized inference and generation through a learned latent space.

Study & implementation 2022 Latent variablesELBOReparameterization
Variational Autoencoder diagram

Motivation

The variational autoencoder pairs a probabilistic decoder with an amortized inference network, learning a smooth latent representation of the data. It is the canonical example of turning intractable posterior inference into optimization of a variational bound.

Method

Training maximizes the evidence lower bound (ELBO): a reconstruction term plus a KL regularizer that pulls the approximate posterior toward the prior. The reparameterization trick makes the whole objective differentiable end-to-end.

\[ \mathcal{L}(\theta,\phi;x) = \mathbb{E}_{q_\phi(z\mid x)}\!\big[\log p_\theta(x\mid z)\big] - D_{\mathrm{KL}}\!\big(q_\phi(z\mid x)\,\|\,p(z)\big) \]

Mathematical core

The ELBO is the same variational principle that reappears across inference and diffusion. Studying the VAE clarifies the trade-off between reconstruction fidelity and latent regularity, and the geometry the KL term imposes on the latent manifold.