Expectation-Maximization

Chapter 16 Probability & information

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

Open Chapter 16 companion →

Read the full definitions, figures, and worked examples in Chapter 16: Variational Inference and Latent Variables — see the mind-map node Expectation Maximization.

PNG Icons

Textless (256×256 px)
PNG 256×256 px Copy PNG URL
Textless (64×64 px)
PNG 64×64 px Copy PNG URL
Textless (32×32 px)
PNG 32×32 px Copy PNG URL

Animated GIFs

Animated GIF (256×256 px)
GIF 256×256 px Copy GIF URL
Animated GIF (128×128 px)
GIF 128×128 px Copy GIF URL
Animated GIF (64×64 px)
GIF 64×64 px Copy GIF URL