Implemented a Denoising Diffusion Probabilistic Model (DDPM) for denoising MNIST data, based on the paper "Denoising Diffusion Probabilistic Models" by Jonathan Ho, Ajay Jain, and Pieter Abbeel from UC Berkeley (arXiv:2006.11239v2).
-
Model Initialization:
- Implemented the
__init__
function in theMNISTDiffusion
class. - Initialized the UNet model using the provided
_cosine_variance_schedule
function.
- Implemented the
-
Forward Diffusion:
- Utilized the reparameterization trick for the forward pass.
- Implemented the
forward
and_forward_diffusion
functions. - Sampled
t
uniformly from the timesteps for each training sample.
-
Reverse Diffusion:
- Implemented reverse diffusion using trainable mean and variance parameters from the UNet model.
- Developed the
_reverse_diffusion
function.
-
Image Sampling:
- Implemented the sampling procedure.
- Developed the
sampling
function to generate noise and run reverse diffusion for each sample. - Returned the entire trajectory of samples.
-
Model Training:
- Selected hyperparameters such as learning rate, batch size, epochs, and timesteps.
- Chose optimizer, loss function, and learning rate scheduler.
- Displayed 36 final samples using provided code.
- Visualized a sample diffusion trajectory demonstrating noise turning into a clean sample.
- Labeled each image with corresponding denoising step.
- Ensured code is well-documented and organized for reproducibility.
Note: Please refer to the provided code and documentation for detailed implementation and explanations.