Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Example usage of diffusion process

python generate_colored_mnist_diffusion.py
$ python examples/diffusion/generate_colored_mnist_diffusion.py
Epoch 50/50: 100%|██████████| 469/469 [loss=0.0041 avg_loss=0.0049]
Generating 10 images with context tensor([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])..

Generate colored digits

The forward (diffusion) process is gradually adding Gaussian noise to the image at each timestamp:

q(x_{0:T}) = \underbrace{q(x_0)}_{\text{Image}} \prod \underbrace {q(x_t|x_{t-1})}_{\mathcal N_t}

The reverse process is learning the Gaussian transitions to restore the image:

p(x_{0:T}) = \underbrace{ p(x_T) }_{\mathcal N(\mathbf 0,\,\mathbf I)} \prod \underbrace{p_{\theta} (x_{t-1}|x_{t})}_{\mathcal N_t(\mu_\theta,\,\sigma^2\mathbf I)}