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.
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.
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
- Wasserstein GANused by · A Wasserstein GAN is a generative adversarial network that uses a critic and a Wasserstein-based objective to compare generated and real-data distributions.
- WGAN-GPused by · WGAN-GP is a Wasserstein generative adversarial network variant that adds a gradient penalty to constrain the critic and stabilize training.
- population stability indexalternative to · The population stability index (PSI) is a measure of the difference between two probability distributions, often used to quantify shifts in a population or model inputs.
- probability distributionmeasures · A probability distribution is a mathematical specification assigning probabilities to the possible values or outcomes of a random variable, with total probability one.
- driftmeasures · Drift is a change over time in a system’s behavior, state, data, or configuration relative to a reference or expected baseline.
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.



