Variational inference¶
We try to approximate the posterior using a distribution from tractable family.
We assume that \(q\) has some free parameters that we can optimize, make the approximation as tight as possible.
To do this we usually minimize the KL divergence:
\(p^*(x)\) is our posterior distribution.
This is hard to compute since the expectation \(\sum_x p^*(x)\) is not tractable. Instead we work with the reverse KL divergence
If we choose \(q\) right this is tractable. But evaluating \(p^*(x) = p(x|D)\) point-wise is hard, since it requires to evaluate the normalization constant \(Z = p(D)\). We have to use the un-normalized distribution:
The objective function becomes:
Here Z is an constant, thus by minimizing \(J(q)\) we will force q to become close to \(p^*\).
KL divergence is nonnegative, thus \(J(q)\) can be viewed as an upper bound on the NLL(negative log likelihood).
By minimizing \(J(q)\) we essentially maximize the lower-bound of the log likelihood \(\log p(D)\). Because of this \(-J(q)\) is called the variational lower bound or evidence lower bound (ELBO).
Mean field method¶
One of the most popular variational inference methods. It assumes that the posterior is fully factorized approximation of the form:
Our goal is to solve this optimization problem: