liveBook · Manning

Wasserstein distance

Wasserstein distance is a distance between probability distributions defined by the minimum cost of transporting probability mass between them under a specified ground distance.

How 4 Manning books explain it

Learn Generative AI with PyTorch

A distance measure used in Wasserstein GAN training to compare distributions and provide a smoother optimization signal than standard GAN losses.

How it is used
Stabilizes GAN training by replacing binary cross-entropy with a distribution-distance signal and gradient penalty.
How deep it goes
Explains critic scores, the 1-Lipschitz constraint, interpolation, gradient norms, and penalty construction without mathematical derivation.
Examples
Uses conditional face generation, interpolated images, and MuseGAN music pieces to demonstrate Wasserstein training.
What you can do after
Apply it via WGAN-GP training loops for conditional image or music generation and monitor critic-based loss construction.

Read how Learn Generative AI with PyTorch explains Wasserstein distance →

Machine Learning Platform Engineering

Wasserstein distance is a measure of dissimilarity between probability distributions based on the minimum cost of transforming one distribution into another.

How it is used
Detects data drift by comparing baseline and current feature distributions in Evidently monitoring workflows.
How deep it goes
Defines the measure, interprets its score and threshold, but stops short of mathematical derivation or implementation internals.
Examples
Uses reference and inference datasets, Evidently drift reports, HTML output, dashboards, and column-level drift metrics.
What you can do after
Operate Evidently to generate drift reports, inspect Wasserstein scores, and flag features exceeding the default threshold.

Read how Machine Learning Platform Engineering explains Wasserstein distance →

Evolutionary Deep Learning: Genetic algorithms and neural networks

A distance between probability distributions that measures the minimum transport cost required to transform one distribution into another.

How it is used
Improves GAN training by replacing probability-based loss with an earthmover-style distance between real and generated distributions.
How deep it goes
Explains the critic concept and distribution intuition, then implements loss, optimizer, and weight clipping without formal derivation.
Examples
Demonstrates a Wasserstein DCGAN with MNIST digits, optional Fashion-MNIST data, RMSprop, critic training, and clipped weights.
What you can do after
Apply it via Python and Keras by adapting a DCGAN with a critic, Wasserstein loss, shared RMSprop settings, and weight clipping.

Read how Evolutionary Deep Learning: Genetic algorithms and neural networks explains Wasserstein distance →

Machine Learning System Design

Wasserstein distance is a metric between probability distributions defined by the minimum cost of transporting mass from one distribution to another.

How it is used
Uses distribution distance to alert on prediction drift and input data drift before model-quality changes become visible.
How deep it goes
Defines transport-based distribution comparison and applies thresholding, but does not derive the metric or explain its algorithm.
Examples
Uses retail forecasts, a 0.1 alert threshold, and April year-over-year comparisons adjusted for 15% expected growth.
What you can do after
Diagnose drift by comparing distributions, setting alerts, and adjusting control data for known business growth.

Read how Machine Learning System Design explains Wasserstein distance →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.