\textbf{Naresh Kumar Devulapally}
\text{CSE 4/555: Intro to Pattern Recognition}

Article link for the math derivation discussed in class with live code!!

\text{Lecture 3}
\text{Denoising Diffusion Probabilistic Models}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
  • Recap of the Generative AI model architectures.
  • The bigger picture in all generative models.
  • The bottleneck in Variational AutoEncoders.
  • Diffusion Models (Recent Models).
  • Forward Diffusion Process
  • Reverse Diffusion Process
  • Training Architecture
  • Coding Example

\( \text{Agenda of this Lecture:}\)

\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{VAEs - Recap}
P(x \mid z)
P(z \mid x)

Posterior

Generative Model

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Conditional Variational AutoEncoders}
P(x \mid z)
P(z \mid x)

Posterior

Generative Model

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Conditional Variational AutoEncoders}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Generative Adversarial Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{VAEs to Diffusion Models}

Data reconstruction using VAEs

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
  • Forward Process
  • Reverse Process

Diffusion Models

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Expectation

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Jensen's Inequality

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

KL Divergence

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

VAE Loss

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Notation

  • \( x_0 \) : Original data sample (image, audio, etc.)
  • \( x_t \): Noised version of \( x_0 \) at timestep \( t \)
  • \( x_T \): Final noise, ideally standard Gaussian
  • \( \beta_t \): Variance schedule, determines noise magnitude at step \( t \)
  • \( \alpha_t = 1 - \beta_t,\quad \bar{\alpha}_t = \prod_{s=1}^t \alpha_s \)
  • Noise is added as:
x_t = \sqrt{\bar{\alpha}_t} x_0 + \sqrt{1 - \bar{\alpha}_t} \, \epsilon,\quad \epsilon \sim \mathcal{N}(0, I)
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models}
\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

What does \( \beta_t \) do?

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Forward and Reverse Processes

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Forward Process

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Forward Process

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Reverse Process

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Diffusion Loss

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Diffusion Loss

Calvin Luo's

Diffusion Tutorial

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Diffusion Loss

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Diffusion Loss

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Reverse Process Update

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

Summary

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{July 10, 2025}
\text{Diffusion Models - Part 2}

References

\text{Apr. 3, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 7, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}
\text{Naresh Kumar Devulapally}
\text{Apr. 2, 2026}
\text{CSE 4/555: Pattern Recognition, Sp. 26}