Expectation-Maximization
Chapter 16: Variational Inference and Latent Variables — Expectation-Maximization
From the book
Chapter 16: Variational Inference and Latent Variables. In the chapter mind map this icon labels **Expectation Maximization. The discussion below is excerpted and lightly edited from § Expectation-Maximization** in Mathematics for AI and Machine Learning.
EM is an iterative algorithm that maximizes the log-likelihood by alternating between two steps: the E-step (Expectation) computes the exact posterior $p_{\boldsymbol\theta}(\mathbf z | \mathbf x)$ when it's tractable, and the M-step (Maximization) updates model parameters $\boldsymbol\theta$ to maximize the expected log-likelihood.
For every distribution $q$ over $\mathbf z$, $\log p_{\boldsymbol\theta}(\mathbf x) = \mathrm{ELBO}(q, \boldsymbol\theta) + D_{\mathrm{KL}}\big(q \,\|\, p_{\boldsymbol\theta}(\mathbf z \mid \mathbf x)\big)$. The E-step sets $q_t$ to the posterior under $\boldsymbol\theta_t$, closing the gap, and the M-step raises the ELBO in $\boldsymbol\theta$, so the log-likelihood never decreases, although EM can stop at a local maximum or a saddle point. The E-step needs the exact posterior, which is available for mixtures such as the GMM and for hidden Markov models, but not for most deep latent-variable models.
What this drawing shows
What you see. Log-likelihood and ELBO curves fixed; red E-step arrow then blue M-step arrow grow in sequence on the variational landscape.
In the mind map. Chapter 16 — Expectation Maximization. See From the book above for definitions, figures, and worked examples.
Where to read next
Read the full definitions, figures, and worked examples in Chapter 16: Variational Inference and Latent Variables — see the mind-map node Expectation Maximization.