Unofficial PyTorch implementation of Denoising Diffusion Probabilistic Models [1].
This implementation follows the most of details in official TensorFlow implementation [2]. I use PyTorch coding style to port [2] to PyTorch and hope that anyone who is familiar with PyTorch can easily understand every implementation details.
pip install -U pip setuptools
pip install -r requirements.txt
Download precalculated statistic for dataset:
Create folder stats
for cifar10.train.npz
.
stats
└── cifar10.train.npz
python main.py --train \
--flagfile ./config/CIFAR10.txt
python main.py --train \
--flagfile ./config/CIFAR10.txt \
--batch_size 64 \
--logdir ./path/to/logdir
CUDA_VISIBLE_DEVICES=1 python main.py --train \
--flagfile ./config/CIFAR10.txt
CUDA_VISIBLE_DEVICES=0,1,2,3 python main.py --train \
--flagfile ./config/CIFAR10.txt \
--parallel
flagfile.txt
is autosaved to your log directory. The default logdir for config/CIFAR10.txt
is ./logs/DDPM_CIFAR10_EPS
python main.py \
--flagfile ./logs/DDPM_CIFAR10_EPS/flagfile.txt \
--notrain \
--eval
CUDA_VISIBLE_DEVICES=0,1,2,3 python main.py \
--flagfile ./logs/DDPM_CIFAR10_EPS/flagfile.txt \
--notrain \
--eval \
--parallel
The checkpoint can be downloaded from my drive.