Diffusion from scratch

A class-conditional diffusion model written from PyTorch primitives, trained on MNIST digits and FashionMNIST clothing. Each row shows one sample of every class, all generated from the same starting noise, so every change you see comes from the setting you move.

Loading samples…

Guidance and sampler steps

0 = unconditional, 1 = plain conditional, higher = stronger pull toward the requested class.

DDIM can skip timesteps; DDPM takes all 1000 (shown at guidance 2).

What the experiments show

FID is measured on 1,000 samples per setting in a small classifier's feature space (lower is better; real images score about 3), so it compares settings within this project, not with published numbers.

Two charts: FID and class accuracy against DDIM step count at guidance 2, with DDPM 1000 and real images as reference lines. DDIM stays below DDPM's FID at every step count.
MNIST, guidance 2: DDIM quality across step counts, with 1000-step DDPM and real images for reference.

Full tables, the FashionMNIST results, and the schedule ablation are in the README; the math behind each sampler is in NOTES.md.