The interactive film is in the book's Companion

Play it, pause it, turn it and drag it with Mathematics for AI and Machine Learning.

Get the book

Wasserstein Distance: the Cheapest Way to Move the Earth

Chapter 14 · Mathematics for AI and Machine Learning · Advanced · 1:45

An interactive live film: a transport plan stands as bars on the plane of (x, y) with p and q on two walls; the optimal plan's cost is W_1, the area between the CDFs. Slide q to the shift with the smallest W_1.

Narration

Think of p, on the left wall, as piles of earth, and q, on the back wall, as holes to fill. The question is how much work it takes to move one into the other.

A transport plan is a coupling: a joint distribution on the floor, whose rows add up to p and whose columns add up to q. The mass at a point x, y travels from x to y, so its cost is its distance from the diagonal.

The rest of the narration is in the book's Companion.

More from Chapter 14

Interactive1:42KL Divergence: Two Orders, Two Different FitsChapter 14Preview1:57Entropy, Cross-Entropy and KL: the Wasted BitsChapter 14Preview1:38Entropic Optimal Transport and SinkhornChapter 14Preview1:58The ELBO: a Hill under the EvidenceChapter 14Preview2:04Fisher Information: the Curvature of KLChapter 14Preview1:53The InfoNCE BoundChapter 14