Interactive demos

Three of my papers, running live in your browser on small toy problems. Pick a demo below, drag the clouds and move the sliders.

Subspace Robust Wasserstein

This demo brings to life Subspace Robust Wasserstein Distances (Paty and Cuturi, ICML 2019). Drag either point cloud to move it around.

Optimal transport measures the effort needed to morph one cloud of points, the measure \(\mu\), into the other one, the measure \(\nu\). In high dimension this effort is often dominated by a handful of directions that carry little real information. The paper asks a sharper question: along which low dimensional view are the two clouds the hardest to align? Writing \(P_E\) for the projection onto a subspace \(E\) of dimension \(k\), the subspace robust distance is

$$ \mathcal{S}_k(\mu,\nu)^2 \;=\; \max_{\dim E = k}\ \min_{\pi \in \Pi(\mu,\nu)}\ \int \lVert P_E(x-y) \rVert^2 \, \mathrm{d}\pi(x,y). $$

The data here is two dimensional and we take \(k = 1\), so the worst view is a single line, drawn in yellow. The algorithm goes back and forth until its two steps agree: solve the transport problem along the current line, then turn the line towards the direction that transport stretches the most. The dashed line is ordinary PCA, the direction of largest spread, which usually points somewhere else.

first cloud (μ) second cloud (ν) worst-case line (k = 1) PCA
robust distance S₁: ordinary Wasserstein W₂: angle of the worst-case line:

Everything runs live on a few dozen points. The transport step uses entropic optimal transport (Sinkhorn), and the new line is the leading eigenvector of the transport weighted spread of the displacements. The projection \(P\) ranges over \(\{P : 0 \preceq P \preceq I,\ \operatorname{tr} P = 1\}\), exactly as in the paper. Original Python code.