Ask what should change when the equation is manipulated, then let the visualization test that expectation.
Foundation Lab
Optimal Transport & Wasserstein Distance
Wasserstein distance explains why WGANs are more stable than vanilla GANs—it provides gradients even when distributions do not overlap
W_p(\mu, \nu) = \left( \inf_{\gamma \in \Gamma(\mu, \nu)} \int \|x - y\|^p \, d\gamma(x, y) \right)^{1/p}Selected Foundation Object
Keep the equation fixed; move through the evidence.
KL divergence is infinite when supports do not overlap; Wasserstein is finite and measures "how far to move mass"
W_p(\mu, \nu) = \left( \inf_{\gamma \in \Gamma(\mu, \nu)} \int \|x - y\|^p \, d\gamma(x, y) \right)^{1/p}Use the runnable panel, the key equation, and canonical papers as separate forms of evidence for the same object.
The useful learning product is the reusable mechanism you can carry into another model, paper, or engineering tradeoff.
Use prerequisites, dependents, and semantic links to repair the next gap without leaving the object behind.
Why It Matters for Modern Models
- Wasserstein distance explains why WGANs are more stable than vanilla GANs—it provides gradients even when distributions do not overlap
- Flow matching and rectified flows are built on OT: they learn the optimal transport map directly
- OT provides a principled way to measure distance between distributions that respects geometry
What Tutorials Skip
What is still poorly explained in textbooks and papers:
- KL divergence is infinite when supports do not overlap; Wasserstein is finite and measures "how far to move mass"
- The "earth mover" intuition: imagine distributions as piles of dirt, OT finds the cheapest way to reshape one into the other
- Entropic regularization (Sinkhorn) makes OT tractable: adds −εH(γ) to get differentiable, GPU-friendly algorithms
Interactive Visualization
Core Math (Optional Deep Dive)
If you want intuition first, start with the key equation and the visualization. Come back here for the full walkthrough.
Optimal transport finds the minimum-cost way to move mass from distribution to :
where is the set of joint distributions with marginals .
Kantorovich duality (key for computation):
Brenier's theorem: For absolutely continuous , the optimal map is for convex .