Diffusion-DDPM-扩散模型-公式速查

Diffusion-DDPM-扩散模型-公式速查


扩散过程

操作 分布形式 计算形式 备注
x 0 \bold{x}_0 x0 x t \bold{x}_t xt q ( x t ∣ x 0 ) = N ( x t ; α ˉ t x 0 , ( 1 − α ˉ t ) I ) q(\bold{x}_t|\bold{x}_0)=\mathcal{N}(\bold{x}_t;\sqrt{\bar{\alpha}_t}\bold{x}_0,(1-\bar{\alpha}_t)\bold{I}) q(xtx0)=N(xt;αˉt x0,(1αˉt)I) x t = α ˉ t x 0 + 1 − α ˉ t ϵ x 0 = 1 α ˉ t x t − 1 − α ˉ t α ˉ t ϵ \bold{x}_t = \sqrt{\bar{\alpha}_t}\bold{x}_0 + \sqrt{1-\bar{\alpha}_t}\boldsymbol{\epsilon} \\ \bold{x}_0=\frac{1}{\sqrt{\bar{\alpha}_t}}\bold{x}_t-\frac{\sqrt{1-\bar{\alpha}_t}}{\sqrt{\bar{\alpha}_t}}\boldsymbol{\epsilon} xt=αˉt x0+1αˉt ϵx0=αˉt 1xtαˉt 1αˉt ϵ ϵ ∼ N ( 0 , I ) α t = 1 − β t α ˉ t = Π s = 1 t α s = α 1 α 2 . . . α t \boldsymbol{\epsilon}\sim\mathcal{N}(\bold{0}, \bold{I} ) \\ \alpha_t=1-\beta_t \\ \bar{\alpha}_t=\Pi_{s=1}^t\alpha_s=\alpha_1\alpha_2...\alpha_t ϵN(0,I)αt=1βtαˉt=Πs=1tαs=α1α2...αt
x t − 1 \bold{x}_{t-1} xt1 x t \bold{x}_t xt q ( x t ∣ x t − 1 ) = N ( x t ; 1 − β t x t − 1 , β t I ) q(\bold{x}_t|\bold{x}_{t-1})=\mathcal{N}(\bold{x}_t;\sqrt{1-\beta_t}\bold{x}_{t-1},\beta_t\bold{I}) q(xtxt1)=N(xt;1βt xt1,βtI) x t = 1 − β t x t − 1 + β t ϵ \bold{x}_t = \sqrt{1-\beta_t}\bold{x}_{t-1} + \sqrt{\beta_t}\boldsymbol{\epsilon} xt=1βt xt1+βt ϵ ϵ ∼ N ( 0 , I ) \boldsymbol{\epsilon} \sim \mathcal{N}(\bold{0}, \bold{I} ) ϵN(0,I)

逆扩散过程

操作 分布形式 计算形式 备注
x T \bold{x}_T xT 的采样 p ( x T ) = N ( x T ; 0 , I ) p(\bold{x}_T)=\mathcal{N}(\bold{x}_T;\bold{0},\bold{I}) p(xT)=N(xT;0,I) x T ∼ N ( 0 , I ) \bold{x}_T \sim \mathcal{N}(\bold{0},\bold{I}) xTN(0,I)
x t \bold{x}_t xt 得到 x t − 1 \bold{x}_{t-1} xt1 p θ ( x t − 1 ∣ x t ) = N ( x t − 1 ; μ θ ( x t , t ) , Σ θ ( x t , t ) ) p_\theta(\bold{x}_{t-1}|\bold{x}_t) = \mathcal{N}(\bold{x}_{t−1};\boldsymbol{\mu}_\theta(\bold{x}_t,t),\boldsymbol{\Sigma}_\theta(\bold{x}_t,t)) pθ(xt1xt)=N(xt1;μθ(xt,t),Σθ(xt,t)) x t − 1 = μ θ ( x t , t ) + Σ θ ( x t , t ) ϵ t \bold{x}_{t-1} = \boldsymbol{\mu}_\theta(\bold{x}_t,t) + \sqrt{\boldsymbol{\Sigma}_\theta(\bold{x}_t,t)}\boldsymbol{\epsilon}_t xt1=μθ(xt,t)+Σθ(xt,t) ϵt ϵ t ∼ N ( 0 , I ) Σ θ ( x t , t ) = σ t 2 I σ t 2 = β t   o r   β ~ t \boldsymbol{\epsilon}_t \sim \mathcal{N}(\bold{0},\bold{I}) \\ \boldsymbol{\Sigma}_\theta(\bold{x}_t,t)=\sigma^2_t\bold{I} \\ \sigma^2_t=\beta_t \space or \space \tilde{\beta}_t ϵtN(0,I)Σθ(xt,t)=σt2Iσt2=βt or β~t
给定 x 0 \bold{x}_0 x0 x t \bold{x}_t xt,求 x t − 1 \bold{x}_{t-1} xt1 q ( x t − 1 ∣ x t , x 0 ) = N ( x t − 1 ; μ ˉ t ( x t , x 0 ) , β ~ t I ) q(\bold{x}_{t-1}|\bold{x}_t,\bold{x}_0)=\mathcal{N}(\bold{x}_{t-1};\bar{\boldsymbol{\mu}}_t(\bold{x}_t,\bold{x}_0),\tilde{\beta}_t\bold{I}) q(xt1xt,x0)=N(xt1;μˉt(xt,x0),β~tI) x t − 1 = μ ˉ t ( x t , x 0 ) + β ~ t ϵ t \bold{x}_{t-1}=\bar{\boldsymbol{\mu}}_t(\bold{x}_t,\bold{x}_0)+\sqrt{\tilde{\beta}_t}\boldsymbol{\epsilon}_t xt1=μˉt(xt,x0)+β~t ϵt μ ˉ t ( x t , x 0 ) = α ˉ t − 1 β t 1 − α ˉ t x 0 + α t ( 1 − α ˉ t − 1 ) 1 − α ˉ t x t β ~ t = 1 − α ˉ t − 1 1 − α ˉ t β t \bar{\boldsymbol{\mu}}_t(\bold{x}_t,\bold{x}_0)=\frac{\sqrt{\bar{\alpha}_{t-1}}\beta_t}{1-\bar{\alpha}_t}\bold{x}_0+\frac{\sqrt{\alpha_t}(1-\bar{\alpha}_{t-1})}{1-\bar{\alpha}_t}\bold{x}_t \\ \tilde{\beta}_t=\frac{1-\bar{\alpha}_{t-1}}{1-\bar{\alpha}_t}\beta_t μˉt(xt,x0)=1αˉtαˉt1 βtx0+1αˉtαt (1αˉt1)xtβ~t=1αˉt1αˉt1βt

你可能感兴趣的:(人工智能,算法,python)