A from-scratch implementation of Denoising Diffusion Probabilistic Models (DDPM) on CIFAR-10, following:
- Ho et al. (2020) — DDPM core
- Nichol & Dhariwal (2021) — Cosine noise schedule
- Song et al. (2021) — DDIM sampling
- Ho & Salimans (2021) — Classifier-free guidance
- ~35M-parameter U-Net
- Base channels: 128, multipliers: [1, 2, 2, 2]
- Self-attention at 16×16 only, 2 ResBlocks per resolution
- T=1000 timesteps, cosine schedule, ε-prediction
- Classifier-free guidance via label dropout (single training run)
MacBook Air (M2) ──git push──▶ GitHub ──git clone──▶ Kaggle GPU
develop/test source of truth train
# First-time setup
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -e .
# Run tests
pytest tests/ -v
# Development cycle
git add . && git commit -m "description" && git push- Create a Kaggle Notebook and attach a GPU (e.g., P100 or T4x2).
- Clone this repository directly in the Kaggle notebook.
- Install requirements using
pip install -r requirements-kaggle.txt. - Run the training script:
python scripts/train.py --use_amp.
Never edit code in Kaggle cells. All logic lives in the ddpm/ package.
Checkpoints save to the /kaggle/working/checkpoints directory. Be sure to persist them (or download them) to survive disconnects. The training loop auto-resumes from the latest checkpoint if provided in the --checkpoint_dir.
Every training run is logged in experiments/exp_log.md with:
- Run ID (
run_YYYYMMDD_HHMMSS) - Git commit hash (captured at training start)
- Config summary, steps completed, final loss, FID (if evaluated), notes
Rule: One change at a time between runs.
ddpm/ Python package — ALL logic here
tests/ Unit tests — run locally before pushing
notebooks/ Colab thin-shell notebooks
scripts/ CLI entry points
docs/ Learning notes, paper notes, decisions
experiments/ Experiment log
See task_plan.md for current milestone status.