ELBO Loss
ℒ = ℒ_recon + β · KL
Reconstruction Loss (Binary Cross-Entropy)
ℒ_recon = −Σ [ x·log(x̂) + (1−x)·log(1−x̂) ]
KL Divergence (closed form)
KL = −½ Σ [ 1 + log σ² − μ² − σ² ]
Reparameterization Trick
The trick decouples stochasticity from parameters, making backpropagation through sampling possible:
z = μ + σ ⊙ ε where ε ∼ 𝒩(0, I)
Why 2-D Latent Space?
A 2-D latent space lets us visualise the full manifold as a 2-D scatter plot. Higher dimensions improve quality but lose direct interpretability.
Each point is an MNIST digit encoded via the VAE's encoder. Colour = digit class (0–9). Well-separated clusters indicate a structured latent manifold.
Row 1: original MNIST samples | Row 2: VAE reconstructions. Blurriness reflects the smoothing nature of the reconstruction loss.