Log inStart free
LESSON 25.04 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Variational autoencoders

A variational autoencoder squeezes an image into 2 numbers, then draws new images.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 25.04 · VAE BAYμ (0.12, 1.87) · σ (0.17, 0.25)
01
Stage 1 of 6 · Encode
The encoder reads the 64 pixels of "ring top left". It gives a mean μ and a spread σ for each latent code number.
Explain it simply

On the left is one image, 8 by 8 pixels. The encoder squeezes it into a code of only 2 numbers. For each number it gives a best guess, mu, and an uncertainty, sigma. It outputs log sigma squared, so any output gives a positive sigma.

The image ring top left goes into the encoder. The mean is (0.12, 1.87) and the spread is (0.17, 0.25).

image, μ and σnoise ε and lossdecoded imageprior N(0, 1)
encoder0.121.870.170.25μσimage x"ring top left"μ = (0.12, 1.87) σ = (0.17, 0.25)encoder0.121.870.170.25μσimage x"ring top left"μ = (0.12, 1.87) σ = (0.17, 0.25)
Toy: 12 images of 8×8 pixels, a 2-number latent code
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
μ, log⁡σ2=Enc(x)\sy{mu}{data}{\mu},\ \log \sy{sigma}{data}{\sigma}^2 = \mathrm{Enc}(\sy{x}{data}{x})
μ=(0.12,1.87), σ=(0.17,0.25)\mu = (0.12, 1.87),\ \sigma = (0.17, 0.25)

The encoder maps the image to a mean and a spread.

Common mix-ups

MYTHAny autoencoder can draw new images from random codes.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01Pick another noise draw. Does the mean μ change?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.