---
# System prepended metadata

title: DDPM（Denoising Diffusion Probabilistic Models)
tags: [Diffusion model]

---

---
tags: Diffusion model
---
![](https://i.imgur.com/UMIw21Z.jpg)

![](https://i.imgur.com/uYEsz04.png)

# DDPM（Denoising Diffusion Probabilistic Models)
定義一個噪聲過程，並嘗試學習一個神經網路來恢復噪聲過程

## original loss function
$$L_{vlb} := L_0 + L_1 + \dots + L_{T-1}+L_T \\
L_0 := -\log p_\theta(x_0|x_1) \\ 
L_{t-1} := D_{KL}(q(x_{t-1}|x_t,x_0) || p_\theta(x_{t-1}|x_t)) \\
L_T := D_{KL}(q(x_T|x_0) || p(x_T))\\
$$

## simple loss function
$$L_{simple} = E_{t,x_0,\epsilon}[||\epsilon - \epsilon_\theta(x_t,t)||^2]$$

由神經網路添加的噪點應該要匹配到前向加噪的噪點


![](https://i.imgur.com/9Olj1mZ.png)


$$p_\theta(x_{t-1}|x_t) := \mathscr{N}(x_{t-1};\color{blue}{\mu_\theta}(x_t,t),\color{blue}{\Sigma_\theta}(x_t,t))$$


猜測：想要找出 $x_{t-1} \rightarrow x_{t}$ 時的高斯雜訊的高斯分佈，並將 $x_{t-1} = x_{t} + \text{雜訊}$，以此來求出$x_{t-1}$ (U-net)

在論文中，$\Sigma_\theta$ 是被固定住的，真正要求的只有 $\mu_\theta$。

* $\Sigma_\theta(x_t,t) = \beta_t$(待確認) 

$$p_\theta(x_{0:T}):=p(X_T)\prod\limits_{t=1}^T p_\theta(x_{t-1}|x_t)$$


$$p(x_T)=\mathscr{N}(x_T;0,I) \leftarrow 高斯分佈$$