0PricingLogin
Learn AI with Python · Lesson

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

  1. Autoencoders for Representation Learning
  2. Variational Autoencoders (VAE)
  3. GANs: Generator and Discriminator
  4. Conditional GANs and Style Transfer
← Back to Learn AI with Python