Diffusion Lab

Watch a tiny neural net learn to turn noise into shape, live in your browser.

step 0  ·  loss —
idle

How it works

A 2→64→64→2 MLP with a sinusoidal time embedding is trained to predict the Gaussian noise added to target points (DDPM ε-objective, fixed linear β-schedule). Sampling reverses the chain: from pure noise it iteratively subtracts predicted noise, and the cloud condenses into the shape. Everything — net, autograd, training — runs in plain JS.

Why it matters

The same denoising principle powers image, audio and molecule generators. Seeing it on a 2D point cloud strips away the scale so the core idea — learn to remove noise, then run that removal backwards — becomes tangible and inspectable.

← Gallery