Score based models

diffusion gif

This repo contains some naive implementations of various score-based generative models.

Installation

To install this library, simply run the following command after cloning the repo :

pip install -e .

Methods

The supported methods are:

Run

NCSN

  • 2D gaussian example: notebooks/ncsn_2d_example.ipynb

  • CIFAR-10:

cd scripts
python ncsn_train_cifar10.py --dataset cifar10

You can visualise the CIFAR-10 samples in notebooks/ncsn_view.ipynb.

DDPM

  • 2D gaussian example: notebooks/ddpm_2d_example.ipynb

  • CIFAR-10, Butterfiles:

cd scripts
python ddpm_train.py --dataset [dataset-name]

where [datase-name] can be cifar10 | butterflies.

You can visualise the CIFAR-10 and Butterflies samples in notebooks/ddpp_view.ipynb.

CDDPM

cd scripts
python ddpm_cond_train.py --dataset m1guelpf/nouns

You can visualise the Nouns samples in notebooks/ddpp_cond_view.ipynb.

Results

NCSN

  • 2D Gaussian mixture

Gradient field

  • CIFAR-10 (32 x 32)

CIFAR-10

DDPM

  • CIFAR-10 (32 x 32)

CIFAR-10

  • Butterflies (128 x 128)

Butterflies

CDDPM

  • Nouns (32 x 32)

Nouns