Maximal Log-likelihood 是很多模型訓練時目標函式. 在訓練時除了 observed data $x$ (蒐集到的 training data) 還會有無法觀測的 hidden variable $z$ (例如 VAE 中 encoder 的結果).
如何在有隱變量情況下做 MLE, Evidence Lower BOund (ELBO) 就是關鍵. 一般來說, 因為 ELBO 是 MLE 目標函式的 lower bound, 所以藉由最大化 ELBO 來盡可能最大化 likelihood. 另外這個過程也可以用來找出逼近後驗概率 $p(z|x)$ 的函式. 本文記錄了 ELBO 在 Variational Inference (VI), Expectation Maximization (EM) algorithm, 以及 Diffusion Model 三種設定下的不同用法.
數學比較多, 開始吧!
開頭先賞一頓數學操作吃粗飽一下
Let $p,q$ 都是 distributions, 則下面數學式子成立
$$\log p(x)= KL(q(z)\|p(z|x))+ {\color{orange}{ \mathbb{E}_{z\sim q}\left[\log \frac{p(x,z)}{q(z)}\right]} }\\ =KL(q(z)\|p(z|x))+{\color{orange}{ \mathbb{E}_{z\sim q}\left[\log p(x,z) - \log q(z)\right]} } \\ =KL(q(z)\|p(z|x))+\color{orange}{\mathcal{L}(q)}$$ 因為 $KL(\cdot)\geq0$ 所以 $\mathcal{L(q)}\leq\log p(x)$
基本上 $p,q$ 只要是 distribution 上面式子就成立