Easy to use library for various implementtaions of denoising diffusion models
The diffusion trainer and sampler implemented here can handle arbitrary shapes.
For example, it can handle tensors with shape of (N, C, ...)
, (e.g. (N, C, 1, 2, 3, 4, 5, 6)
), where N
is batch size and C
is channel size).
It will help apply diffusion models in another domain not just images.
It contains:
DDPMTrainer
,DDPMSampler
: (https://arxiv.org/abs/2006.11239)DDIMSampler
: (https://arxiv.org/abs/2010.02502)HeunSampler
: (https://arxiv.org/abs/2206.00364)
Currently working on:
- Include DDPM Trainer and Sampler
- Include DDIM Sampler
- Include Elucidating Diffusion
- Include D3PM
- Test on CIFAR10 dataset
- Show CIFAR10 test results
- Make example how to use (currently no examples here, but you can see here)
- Make example of unconditional generation
- Make example of conditional generation (can be done by modifying
denoise_fn
parameter with other callable function (e.g. pythonlambda
) of trainer and sampler) - Make example of classifier-free guidance generation
pip install dfusion
I borrwed source codes largely from the following repositories. Many codes are mixtured and done refactoring.