Skip to content

Commit

Permalink
🎉 修改格式
Browse files Browse the repository at this point in the history
  • Loading branch information
Relph1119 committed Oct 14, 2023
1 parent 7105f4b commit 9d26bf4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
20 changes: 10 additions & 10 deletions docs/diffusion_models_learning51/ch01.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ $$
- 反向过程(数据去噪化):从采样自高斯噪声$x \sim \mathcal{N}(0, I)$的随机噪声中恢复出原始数据$x_0$,通过由一系列用神经网络参数化的高斯分布组成的马尔可夫链进行数据去噪。

从时间步$t$到时间步$t - 1$的单步反向“去噪”过程:
$$
$$
q(x_{t - 1} | x_t, x_0) = \mathcal{N} (x_{t - 1}; \tilde{\mu}(x_t, x_0), \tilde{\beta_t} I)
$$
其中,均值为
$$
$$
  其中,均值为
$$
\tilde{\beta_t} = \frac{ 1 - \bar{\alpha}_{t - 1}}{ 1 - \bar{\alpha}_t} \cdot \beta_t
$$
方差为
$$
$$
  方差为
$$
\tilde{\mu}(x_t, x_0) = \frac{\sqrt{\alpha_t} (1 - \bar{\alpha}_{t - 1})}{1 - \bar{\alpha}_t} x_t + \frac{ \sqrt{ \bar{\alpha}_{t - 1} } \beta_t }{1 - \bar{\alpha}_t} x_0
$$
$$

- 优化目标:要求反向过程中预测的噪声分布与前向过程中施加的噪声分布之间的“距离”最小。

优化目标公式:
$$
$$
L_{t - 1}^{\text{simple}} = \mathbb{E}_{x_0, \epsilon \sim \mathcal{N}(0, I)} \left[ \| \epsilon - \epsilon_{\theta} \left( \sqrt{\bar{\alpha}_t} x_0 + \sqrt{1 - \bar{\alpha}_t} \epsilon, t \right) \|^2 \right]
$$
$$

## 1.2 扩散模型的发展

Expand Down
16 changes: 8 additions & 8 deletions notebook/diffusion_models_learning51/my_homework/ch01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,17 @@
"- 反向过程(数据去噪化):从采样自高斯噪声$x \\sim \\mathcal{N}(0, I)$的随机噪声中恢复出原始数据$x_0$,通过由一系列用神经网络参数化的高斯分布组成的马尔可夫链进行数据去噪。\n",
"\n",
" 从时间步$t$到时间步$t - 1$的单步反向“去噪”过程:\n",
" $$\n",
"$$\n",
"q(x_{t - 1} | x_t, x_0) = \\mathcal{N} (x_{t - 1}; \\tilde{\\mu}(x_t, x_0), \\tilde{\\beta_t} I) \n",
" $$\n",
"$$\n",
" 其中,均值为\n",
" $$\n",
"$$\n",
"\\tilde{\\beta_t} = \\frac{ 1 - \\bar{\\alpha}_{t - 1}}{ 1 - \\bar{\\alpha}_t} \\cdot \\beta_t\n",
" $$\n",
"$$\n",
" 方差为\n",
" $$\n",
"$$\n",
"\\tilde{\\mu}(x_t, x_0) = \\frac{\\sqrt{\\alpha_t} (1 - \\bar{\\alpha}_{t - 1})}{1 - \\bar{\\alpha}_t} x_t + \\frac{ \\sqrt{ \\bar{\\alpha}_{t - 1} } \\beta_t }{1 - \\bar{\\alpha}_t} x_0 \n",
" $$"
"$$"
]
},
{
Expand All @@ -92,9 +92,9 @@
"- 优化目标:要求反向过程中预测的噪声分布与前向过程中施加的噪声分布之间的“距离”最小。\n",
"\n",
" 优化目标公式:\n",
" $$\n",
"$$\n",
"L_{t - 1}^{\\text{simple}} = \\mathbb{E}_{x_0, \\epsilon \\sim \\mathcal{N}(0, I)} \\left[ \\| \\epsilon - \\epsilon_{\\theta} \\left( \\sqrt{\\bar{\\alpha}_t} x_0 + \\sqrt{1 - \\bar{\\alpha}_t} \\epsilon, t \\right) \\|^2 \\right] \n",
" $$"
"$$"
]
},
{
Expand Down

0 comments on commit 9d26bf4

Please sign in to comment.