/DFusion

A library to make it easy to implement diffusion models

Primary LanguagePython

Results

CIFAR10_HEUN

DFusion

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:

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. python lambda) of trainer and sampler)
  • Make example of classifier-free guidance generation

Installation

pip install dfusion

Acknowledgement

I borrwed source codes largely from the following repositories. Many codes are mixtured and done refactoring.