Skip to content
SakshamDevPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

17 Commits

Folders and files

Repository files navigation

DDPM From Scratch — CIFAR-10

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

Architecture

  • ~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)

Development Workflow

MacBook Air (M2) ──git push──▶ GitHub ──git clone──▶ Kaggle GPU
   develop/test                  source of truth       train

Local Development (MacBook Air)

# 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

Kaggle Training

  1. Create a Kaggle Notebook and attach a GPU (e.g., P100 or T4x2).
  2. Clone this repository directly in the Kaggle notebook.
  3. Install requirements using pip install -r requirements-kaggle.txt.
  4. Run the training script: python scripts/train.py --use_amp.

Never edit code in Kaggle cells. All logic lives in the ddpm/ package.

Checkpoints

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.

Experiment Logging

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.

Project Structure

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

Roadmap

See task_plan.md for current milestone status.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages