Generative AI Visualizations

These lessons examine learned representations and ways to generate data. An autoencoder reconstructs an existing input through a latent code. GANs and diffusion models produce samples from noise. For generation, one plausible output is a limited test: the model might produce that same output every time. Inspect both where samples land and what parts of the data they miss.

What These Lessons Cover

LessonWhat you watchWhat the experiment tests
AutoencoderTrained encoder and decoder networks reconstruct an 8×8 image through a small latent code.A wider bottleneck improves the selected digit but does not make a digit-trained decoder a universal copier.
GANTwo small networks train on a one-dimensional distribution. D revises its judgments, then G learns through the fixed D.A mean discriminator score near 0.5 does not prove a match. Identical latent inputs produce identical outputs even after training.
Diffusion ModelsA deterministic DDIM sampler repeatedly applies an exact analytical denoiser to two-dimensional samples.One high-noise estimate can land between data groups; repeated estimates at changing noise levels resolve their structure.

A Recommended Learning Order

Start with Training Loop if parameter updates and evaluation are unfamiliar. Autoencoder introduces a latent representation with the original input as its reconstruction target. Then open GAN, where generated samples have no paired real targets. Watch the first D update: the score curve changes while G's output positions stay fixed. During the G update, the curve stays fixed while output positions change. The final fresh batch shows why D can be removed from the generation path.

Continue with Diffusion Models to examine an iterative generation procedure. Its denoiser is an exact calculation for a known distribution, not a neural network trained during the lesson. Compare the first clean estimate with the repeated-denoising result while holding the starting noise fixed.

Compare the Evidence, Not Just the Samples

The GAN experiment runs real small-network optimization. Its losses and outputs can oscillate, and 400 rounds do not establish convergence. The diffusion experiment isolates sampling with a fixed denoiser; it does not demonstrate the optimization needed to train an image model.

GAN and diffusion use low-dimensional synthetic distributions to make missing groups visible. Neighborhood counts are descriptive checks on finite batches, not general measures of image quality. The autoencoder uses held-out digit images and an unfamiliar checkerboard to test reconstruction. Keep the input and other controls fixed when comparing one changed parameter.

All Generative AI Visualizations

Open a lesson below to play its default experiment, inspect a training or sampling step, and apply a failure-case recipe.