This repository implements a fast, yet simple version of the Denoising Diffusion Probabilistic Models paper for the image generation
task. Denoising score matching technique is used to allow the network for rapid estimation of data distribution’s gradient. Moreover, the Langevin sampling method is also performed to generate images from their corresponding true data distribution. This implementation provides unconditional along with conditional (Classifier-free Diffusion Guidance (CFG) and Exponential Moving Average (EMA)) sampling approaches.
PyTorch
torchvision
numpy
PIL
matplotlib
logging
tqdm
The unconditional model is trained on Landscape Pictures dataset and the conditional model is trained on CIFAR-10 dataset.
- To see the implementation of conditional and unconditional sampling methods, check
DDPM.py
. - All the network architectures for
EMA
,UNet
, etc. can be found in themodels.py
file. - To train DDPMs for either of the sampling approaches (conditional and unconditional) and generate the images, run
DDPM
.py. - All hyperparameters to control the training and testing phases of the model are provided in the given
DDPM.py
file.
The images generated by both conditional and unconditional models can be seen below:-
Training Dataset | Sampling Type | Generated Images |
---|---|---|
Landscape Pictures | unconditional | |
CIFAR-10 | conditional (on Dog and Deer classes) |