liveBook · Manning

Expectation maximization

As explained in Math and Architectures of Deep Learning

An iterative algorithm for fitting latent-variable models by alternating between computing posterior responsibilities and updating parameters.

Expectation maximization (EM) fits Gaussian mixture model parameters when component assignments are unobserved. It alternates between estimating assignment probabilities and maximizing parameters under those soft assignments. section 6.9.4

Each iteration separates into two steps:

  • E-step: compute each data point’s posterior responsibility for every mixture component using the current parameters. section 6.9.4
  • M-step: update mixture weights, means, and covariances using responsibility-weighted counts, centroids, and covariances. section 6.9.4
  • Repeat until the likelihood stops increasing, beginning from randomly initialized mixture parameters. section 6.9.4

Fitting a Gaussian mixture

Given an unlabeled point cloud, EM begins with provisional components, calculates log responsibilities with component log probabilities and mixture weights, then updates π, μ, and Σ. After successive iterations, sampled points from the fitted mixture almost match the target cloud. section 6.9.4

Figure 6.12 Progression of maximum likelihood estimation for GMM parameters

(a) Training data point cloud (target for fitting)

(b) Fitted GMM’s sample point cloud at step 0

(c) Fitted GMM’s sample point cloud at step 5

(d) Fitted GMM’s sample point cloud at step 15. It almost matches the target.

Trace the fitted Gaussian mixture from initialization through later iterations as its sampled point cloud approaches the training data. section 6.9.4

How Math and Architectures of Deep Learning covers it

How deep it goes
Explains initialization, E-step responsibilities, M-step parameter formulas, likelihood stopping, and PyTorch computation.
Examples
Uses an unlabeled point cloud, iterative sampled clouds, weighted parameter formulas, and a PyTorch GMM implementation.
What it assumes
Assumes unlabeled training data and a Gaussian mixture with initialized component weights, means, and covariances.
What you can do after
Apply it via PyTorch to fit Gaussian mixture parameters from unlabeled training data.
How it connects
Connects Gaussian mixture models, maximum likelihood estimation, posterior probability, mixture weights, means, and covariance.

Also explained in

Compare how 4 books explain expectation maximization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.