Variational Inference
Last updated
Last updated
相比MCMC,在大数据量采样下,VI要快。 1
\begin{eqnarray*} \ln{P(X)}&=&\ln{(P(X,Z))}-\ln{P(Z|X)}\\ &=&\ln{(\frac{P(X,Z)}{q(Z)})}-\ln{(\frac{P(Z|X)}{q(Z)})}\\ &=&\ln{P(X,Z)}-\ln{q(Z)}-\ln{(\frac{P(Z|X)}{q(Z)})} \end{eqnarray*}
2
3 真实的后验概率往往是十分复杂的,我们用近似 , 并且选择,将每个q分解。这样便于计算积分等。这叫做平均场理论(mean field theory),主要基于基于系统中个体的局部相互作用可以产生宏观层面较为稳定的行为这个物理思想。
l1部分,只关心j部分
l2部分,只关心第j部分 \begin{eqnarray*} L_{2}&=&\int\prod_{i=1}^{M}q_{i}(Z_{i})\sum_{i=1}^{M}\ln{q_{i}(Z_{i})}\,dZ\\ &=&\sum_{i=1}^{M}(\int\limits_{Z_{i}}q_{i}(Z_{i})\ln{q_{i}(Z_{i})}\,dZ_{i}\\ &=&\int\limits_{Z_{j}}q_{j}(Z_{j})\ln{q_{j}(Z_{j})}\,dZ_{j}+const \end{eqnarray*}
4 所以最终可以简化成:
\begin{eqnarray*} L(q)&=&L_{1}-L_{2}\\ &=&\int\limits_{Z_{j}}q_{j}(Z_{j})(E_{i\neq j}(\ln{P(X,Z)}))\,dZ_{j}-\int\limits_{Z_{j}}q_{j}(Z_{j})\ln{q_{j}(Z_{j})}\,dZ_{j}\\ &=&\int\limits_{Z_{j}}q_{j}(Z_{j})\frac{E_{i\neq j}(\ln{P(X,Z)})}{\ln{q_{j}(Z_{j})}}\,dZ_{j} \end{eqnarray*}
再简化:
\begin{equation} \ln{\tilde{P}(X,Z_{j})}=E_{i\neq j}(\ln{P(X,Z)}) \end{equation}
\begin{equation} L(q)=\int\limits_{Z_{j}}q_{j}(Z_{j})\ln{\frac{\tilde{P}(X,Z_{j})}{q_{j}(Z_{j})}}\,dZ_{j}+const=-D_{KL}(q_{j}(Z_{j})||\tilde{P}(X,Z_{j}))+const \end{equation}
【论文每日读】NIPS 2016 Tutorial: Variational Inference
Automatic Differentiation Variational Inference
Hierarchical Variational Models Fast hierarchical Gaussian processes
Hierarchical Variational Models
洪亮劼 【论文每日读】Stein Variational Gradient Descent
Variational Inference with Implicit Probabilistic Models: Part 1:Bayesian Logistic Regression
Variational Inference with Implicit Models Part II: Amortised Inference