Views
No views yet
diffusers is never imported.| Metric | Value |
|---|---|
| FID-tv | 30.12 (10,000 samples, DDIM-50, EMA weights) |
| Steps | 22,098 |
| Images seen | 2.83M (17.4 epochs of CelebA train) |
| Best val loss | 0.0352 (L_simple, MSE on epsilon) |
| Training time | ~9 hours of compute at 87 images/s |
| Parameters | 18,538,371 |
Male, Smiling, Young, Eyeglasses,
Blond_Hair, Bangs.eta parameter that reproduces ancestral DDPM exactly at eta=1.1git clone https://github.com/vous99/mini-diffusion && cd mini-diffusion
2pip install -r requirements.txt
3
4python -c "
5from huggingface_hub import hf_hub_download
6import shutil, os
7os.makedirs('ckpt', exist_ok=True)
8shutil.copy(hf_hub_download('vous99/mini-diffusion', 'best.pt'), 'ckpt/best.pt')
9"
10
11python sample.py # an 8x8 grid
12python sample.py --attrs "Male=1,Eyeglasses=1" # conditional
13python sample.py --guidance-sweep # the guidance-scale figure
14python sample.py --sampler-comparison # DDPM / DDIM / Heunprepare_data.py rebuilds it from the HuggingFace
CelebA shards.base_ch=64, channel_mults=(1,2,2,4) → 64@64² 128@32² 128@16²
256@8². Two ResBlocks per level down, three up, self-attention at 16² and 8² and in the middle
block, head_dim=32, GroupNorm with 32 groups.Linear(6, 256) projection added to the sinusoidal timestep embedding, plus a
learned null vector. Stable Diffusion instead cross-attends to a sequence of text tokens; six
fixed flags are not a sequence, so addition is the honest analogue — the same mechanism, a simpler
carrier.E||eps||² = 1.0000.
That single number confirms the target is epsilon, the data is scaled to [-1,1], and the reduction
is a mean.| Schedule | cosine (Nichol & Dhariwal), T=1000 |
| Prediction target | epsilon |
| Timestep sampling | stratified over the batch, not i.i.d. uniform |
| Optimizer | AdamW, lr 2e-4, betas (0.9, 0.999), weight decay 0, grad clip 1.0 |
| LR schedule | linear warmup 500 steps → cosine decay to 2e-5 |
| Batch | 64 × 2 gradient accumulation = 128 effective |
| EMA | 0.999 with warmup |
| Dropout | 0.0 |
| Augmentation | horizontal flip, p=0.5 |
| Precision | bfloat16 autocast (GroupNorm stays fp32) |
abar_T ≈ 2.4e-9 rather than 0, so the model
never trains on pure noise but is handed pure noise at sampling time. With epsilon-prediction
this shows up as a per-image brightness and colour bias. It receded substantially over training
but has not disappeared; v-prediction with zero terminal SNR is the proper fix.best.pt is a torch.save dict with model (raw weights), ema (averaged weights — what you
should sample from), cfg (the UNetConfig), diffusion (the DiffusionConfig), attributes
(the six conditioning names, in order), iter and val_loss. Load it with checkpoint.py from
the GitHub repository.