Skip to content

ramshty/diffusion-playground

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toy Diffusion Playground

Toy Diffusion Playground is a compact diffusion sandbox for exploring score-based sampling, stochastic differential equations, and a small MNIST DDPM workflow. It packages three runnable demos:

  • 2D Gaussian-mixture score fields and Langevin sampling variants
  • Euler-Maruyama simulations for simple stochastic differential equations
  • An optional toy DDPM on a single MNIST digit

This repo is intentionally modest. It is not a production diffusion library, not a benchmark suite, and not a claim of state-of-the-art generation. The DDPM path is a small-scale reference implementation that trains on one MNIST digit class to keep iteration fast.

What You Can Run

Generate the gallery images:

PYTHONPATH=src python -m toy_diffusion_playground gallery --output-dir docs

Run the demos individually:

PYTHONPATH=src python -m toy_diffusion_playground gmm-demo --output docs/gmm_langevin_overview.png
PYTHONPATH=src python -m toy_diffusion_playground sde-demo --output docs/euler_maruyama_overview.png

Train the optional MNIST DDPM:

PYTHONPATH=src python -m toy_diffusion_playground ddpm-train --output-dir outputs/ddpm --digit 3 --epochs 5

If you want the DDPM workflow, install torchvision first.

Example Outputs

GMM Langevin comparison

Euler-Maruyama overview

Install

Base install:

pip install -e .

Base dependencies are numpy, scipy, matplotlib, and torch. The MNIST DDPM path additionally needs torchvision.

Project Shape

src/toy_diffusion_playground/
  cli.py              command-line entry points
  gmm_langevin.py     Gaussian-mixture score field and Langevin demos
  sde.py              Euler-Maruyama simulator and plots
  ddpm.py             toy MNIST DDPM training and sampling helpers
  unet.py             small UNet used by the DDPM example

Scope

  • The repo focuses on small, inspectable experiments with clear entry points.
  • The implementation covers sampling dynamics and simple generative modeling rather than a full training platform.
  • The DDPM example is included as a compact experiment, not as a polished image generation product.

About

Compact diffusion sandbox with runnable demos for Langevin sampling, Euler-Maruyama SDE simulation, and a small MNIST DDPM.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages