DDPM

Diffusion model은 latent variable 모델이다.

$x_1,..x_T$ 는 latent들이고 data $x_0 \sim q(x_0)$와 같은 dimension을 갖는다.

data에 noise를 더해가는 것을 forward process , noise로 부터 de-noise해나가는 reverse process라한다.

모델은 reverse process를 학습하고 새로운 data를 generation한다.

$$ p_{\theta} (x_0) = \int p_{\theta}(x_{0:T})dx_{1:T} $$

Forward Process (diffusion process)

forward process는 Gaussian noise를 더해가는 과정이고 이는 Markov chain으로 formulate할 수 있다. 즉,

$$ q(x_{1:T}|x_0) = \Pi_{t=1}^Tq(x_t|x_{t-1}) $$

by Markov chain with step T

$\text {where}$

$$ ⁍ $$

각 스텝에서 Gaussian noise를 더한다

Reparameterization trick

만약 우리가

$\alpha_t = 1-\beta_t , \bar \alpha_t = \Pi_{s=0}^t \alpha_s$ 라고 잡는다면, t에서 $x_t$를 sampling하는 것을 closed form으로 쓸 수 있을 것이다.

$$ q(x_t|x_0) = N(x_t;\sqrt {\bar \alpha_t} x_0, (1- {\bar \alpha_t})I) $$

확인을 해보면 t → $\infty$로 갈때 $q(x_t|x_0)$가 $N(x_t;0,I)$로 감도 볼 수 있다

이제 우리는 any timestep t에서 noise를 sampling할 수 있게됐고, 이를 통해 $x_t$를 $x_0$와 $\epsilon$의 함수로 볼수 있게 되어 forward process에서 $x_0$만 알면 바로 $x_t$를 얻을 수 있게됐다.

$$ x_t = \sqrt{\bar \alpha_t}x_0 + \sqrt{1-\bar{\alpha_t}}\epsilon_0 $$

$$ or $$

$$ x_0 = \frac{1}{\sqrt{\bar \alpha_t}}(x_t - \sqrt{1-\bar \alpha_t}\epsilon) $$