This repository implements DDPM with training and sampling methods of DDPM and unet architecture mimicking the stable diffusion unet used in diffusers library from huggingface from scratch.
<img alt="DDPM Math Video" src="https://github.com/explainingai-code/DDPM-Pytorch/assets/144267687/27627399-ca3e-4491-a3f3-34d36e05b9cb" width="300"> <img alt="DDPM Implementation Video" src="https://github.com/explainingai-code/DDPM-Pytorch/assets/144267687/ebcf6a07-c84a-4219-bb2a-31fc7d60cffa" width="300">
For setting up the mnist dataset:
Follow - https://github.com/explainingai-code/Pytorch-VAE#data-preparation
For this one would need to make the following changes
git clone https://github.com/explainingai-code/DDPM-Pytorch.git
cd DDPM-Pytorch
pip install -r requirements.txt
python -m tools.train_ddpm
for training ddpmpython -m tools.sample_ddpm
for generating imagesconfig/default.yaml
- Allows you to play with different components of ddpm Outputs will be saved according to the configuration present in yaml files.
For every run a folder of task_name
key in config will be created
During training of DDPM the following output will be saved
task_name
directoryDuring sampling the following output will be saved
task_name/samples/*.png
@misc{ho2020denoising,
title={Denoising Diffusion Probabilistic Models},
author={Jonathan Ho and Ajay Jain and Pieter Abbeel},
year={2020},
eprint={2006.11239},
archivePrefix={arXiv},
primaryClass={cs.LG}
}