- Diffusion Model #まとめ編
Index
- Index
- Diffusion Probabilistic Model / DPM
- Algorithm
- Loss
- 学習
- Loss
- Noise Conditional Score Networks
- スケジューリングのパラメタ化
- サンプリングの高速化
- クラス付き生成
- 参考
Diffusion Probabilistic Model / DPM
Diffusion Model は、非平衡熱力学から発想を得ている.
マルコフ連鎖を用いて、各 Diffusion Step で、少しずつ画像などの実データにランダムノイズ
を足していく.
モデルは、反対にノイズから少しずつ、実データに近づけていくように学習する
Algorithm
Forward Diffusion Process / 拡散過程
データ は、データ に非常に酷似したデータであるが、データ ではない.
しかし、データ ありきのデータなので、確率分布は、条件付き確率分布である.
- 条件付き確率分布
diffusion step を 回行うとする.
確率分布はこのように更新されていく.
と表現できる.
同じ意味だが、同時分布のみで、こうともかける.
として、
に小さなガウシアンノイズを足していく.
- より、データ成分は、徐々に小さくなる.
- 一方ノイズ は、大きくなっていく.
- 任意の について、 が成り立つ.
実データ は、ステップが進むごとに徐々に自身の特徴を失っていく.
最終的には ()、実データはガウシアンノイズ となる.
つまり、元データ からノイズデータ (潜在空間)へ変換する.
Reverse Diffusion Process / 逆拡散過程
Forward Diffusion Process の逆のプロセス.
Forward Diffusion Process では、データ から を得るための条件付き確率分布 を決定した.
次に、データ から を得るための条件付き確率分布 を得ることを考える.
- Berkeley Symposium on Mathematical Statistics and Probability
さらに、変換
Loss
方法1 / 確率の相対値
Forward Diffusion Process とReverse Diffusion Process の確率の相対値に持っていく.
Naively this integral is intractable – but taking a cue from annealed importance sampling and the Jarzynski equality, we instead evaluate the relative probability of the forward and reverse trajectories, averaged over forward trajectories,
Loss の計算
以下のように、モデルの尤度を設定する.
尤度を最大化したい.
Lower Bound の計算
以下のように、変形する.
Jensen の不等式より、下限を計算.
を以下のように定義し、変換する. (ここの変形は省略)
はエントロピー.
解析可能なエントロピーを KL Divergence のみで表現できた.
方法2
負の対数尤度の最小化を考える.
Loss の設定
Loss を以下のように定める.
さらに変形. (内容は省略)
学習
SVM を用いた学習
- Fast large-scale optimization by unifying stochastic gradient and quasi-Newton methods
- [2013]
- arxiv.org
Loss
学習の方針 / Denoising Score Matching
Simplification
(係数を無視した) 以下の Loss を使うと、学習がよりうまく行うことができる.
Noise Conditional Score Networks
スコア推定に基づく手法.
スケジューリングのパラメタ化
実データからガウシアンノイズへの近づけかたを決定する分散 のスケジュール方法について.
サンプリングの高速化
Denoising Diffusion Probabilistic Model (DDPM) ではん、サンプリングは、
マルコフ連鎖に基づき、数千ステップ繰り返すが、時間がかかる.
Denoising Diffusion Implicit Model (DDIM)
クラス付き生成
Diffusion Model でクラス情報を扱う
参考
Deep Unsupervised Learning using Nonequilibrium Thermodynamics
- [2015]
- v8
- Abstruct
- 1 Introduction
- 1.1 Diffusion probabilistic models
- 1.2 Relationship to other work
- 2 Algorithm
- 2.1 Forward Trajectory
- 2.2 Reverse Trajectory
- 2.3 Model Probability
- 2.4 Training
- 2.5 Multiplying Distributions, and Computing Posteriors
- 2.6 Entropy of Reverse Process
- arxiv.org
Generative Modeling by Estimating Gradients of the Data Distribution
- [2019]
- v3
- Abstract
- 1 Introduction
- 2 Score-based generative modeling
- 2.1 Score matching for score estimation
- Denoising score matching
- Slice score matching
- 2.2 Sampling with Langevin dynamics
- 2.1 Score matching for score estimation
- 3 Challenges of score-based generative modeling
- 3.1 The manifold hypothesis (多様体仮説)
- 3.2 Low data density regions
- 3.2.1 Inaccurate score estimation with score matching
- 3.2.2 Slow mixing of Langevin dynamics
- 4 Noise Conditional Score Networks : learning and inference
- 4.1 Noise Conditional Score Network
- 4.2 Learning NCSNs via score matching
- 4.3 NCSN inference via annealed Langevin dynamics
- arxiv.org
Denoising Diffusion Probabilistic Models
- [2020]
- Abstract
- 1 Introduction
- 2 Background
- 3 Diffusion models and denoising autoencoders
- 3.1 Forward process
- 3.2 Reverse process
- 3.3 Data scaling, reverse process decoder
- 3.4 Simplified training objective
- arxiv.org
書籍
- 拡散モデル
- 2 拡散モデル
- 2.3 デノイジング拡散確率モデル
- 2.3.1 拡散過程と逆拡散過程からなる潜在変数モデル
- 2.3.2 DDPM の学習
- 2.3 デノイジング拡散確率モデル
- 2 拡散モデル
Web サイト
What are Diffusion Models?
- lilianweng.github.io
- 翻訳版 :
【論文解説】Diffusion Modelを理解する