Variational Autoencoders (VAE)
ELBO loss, reparameterization trick, latent space exploration, image generation with VAE.
From Autoencoder to VAE
A plain autoencoder learns scattered points, so sampling new ones produces garbage. A Variational Autoencoder (VAE) learns a smooth, continuous latent space you can sample from, turning it into a true generative model.
Encoding to a Distribution
Instead of one point, a VAE encoder outputs a distribution per input: a mean mu and a log-variance log_var. Each input maps to a small fuzzy region of latent space, not a single dot.
class Encoder(nn.Module):
def __init__(self):
super().__init__()
self.fc = nn.Linear(784, 256)
self.fc_mu = nn.Linear(256, 64)
self.fc_logvar = nn.Linear(256, 64)All lessons in this course
- Autoencoders for Representation Learning
- Variational Autoencoders (VAE)
- GANs: Generator and Discriminator
- Conditional GANs and Style Transfer