
ddpm_unet
Diffusion and generative100 ops230.1K params
The noise-predicting U-Net behind DDPM, the paper that made diffusion models generate sharp images.
Diffusion and generative · 491 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
How this diagram was made
diffusers.UNet2DModel(sample_size=32, in_channels=3, out_channels=3, layers_per_block=2, block_out_channels=[128, 256, 256, 256], down_block_types=['DownBlock2D', 'AttnDownBlock2D', 'DownBlock2D', 'DownBlock2D'], up_block_types=['UpBlock2D', 'UpBlock2D', 'AttnUpBlock2D', 'UpBlock2D'], time_embedding_type='positional', freq_shift=1, flip_sin_to_cos=False, downsample_padding=0, norm_eps=1e-06, norm_num_groups=32, act_fn='silu', attention_head_dim=None, dropout=0.1)
This graph is the denoising network at the heart of a Denoising Diffusion Probabilistic Model, or DDPM. The paper presented high quality image synthesis results using diffusion probabilistic models, a class of latent variable models inspired by considerations from nonequilibrium thermodynamics. A diffusion model is a parameterized Markov chain trained with variational inference to produce samples matching the data after a finite number of steps. The authors note that diffusion models were straightforward to define and efficient to train, but that to the best of their knowledge there had been no demonstration that they could generate high quality samples.
The network you are looking at represents the reverse process: a U-Net backbone similar to an unmasked PixelCNN++ with group normalization throughout. Because the diffusion adds only small amounts of Gaussian noise, the sampling chain transitions can be conditional Gaussians too, which allows a particularly simple neural network parameterization. Rather than predicting the denoised mean directly, the network is trained to predict the noise, a parameterization that both resembles Langevin dynamics and simplifies the variational bound to an objective resembling denoising score matching. Training on this simplified variant of the bound was found beneficial to sample quality and simpler to implement. Parameters are shared across time, with the timestep told to the network through the Transformer sinusoidal position embedding, and self-attention sits at the 16 × 16 feature map resolution.
The architecture follows the backbone of PixelCNN++, a U-Net based on a Wide ResNet, with weight normalization replaced by group normalization to make the implementation simpler. The 32 × 32 models, the configuration captured here, use four feature map resolutions from 32 × 32 down to 4 × 4, with two convolutional residual blocks per resolution level. The CIFAR10 model has 35.7 million parameters, while the LSUN and CelebA-HQ models have 114 million. Dropout was set to 0.1 on CIFAR10 by a sweep, since without it the samples showed artifacts reminiscent of overfitting in an unregularized PixelCNN++.
On unconditional CIFAR10 the model reached an Inception score of 9.46 and a state-of-the-art FID of 3.17, and on 256x256 LSUN its samples were of quality similar to ProgressiveGAN. All experiments ran on a TPU v3-8, where the CIFAR model trained to completion in 10.6 hours at 800k steps.
Key idea. DDPM showed that diffusion probabilistic models can produce high quality image samples, with the best results coming from a weighted variational bound designed according to a novel connection between diffusion models and denoising score matching with Langevin dynamics.
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
@misc{ho2020denoisingdiffusionprobabilisticmodels,
title={Denoising Diffusion Probabilistic Models},
author={Jonathan Ho and Ajay Jain and Pieter Abbeel},
year={2020},
eprint={2006.11239},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2006.11239},
}