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 →
What to know first
- DCGAN / deep convolutional ganA deep convolutional generative adversarial network is a GAN whose generator and discriminator use deep convolutional neural-network architectures.
- discriminatorA discriminator is the model component of a generative adversarial network that distinguishes real data from data generated by its generator.
- generative adversarial networkA generative adversarial network is a generative model in which a generator and a discriminator are trained adversarially, with the generator learning to produce samples resembling data from a target distribution.
- generatorA generator is a computational component or construct that produces data or values from inputs, representations, context, or specified constraints.
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.
- driftmeasures · Drift is a change or divergence over time in a system’s data, state, behavior, or performance relative to a reference or intended condition.
- 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 or probability densities to the possible values or outcomes of a random variable.
- WGAN-GPused by · WGAN-GP is a Wasserstein generative adversarial network variant that adds a gradient penalty to constrain the critic and stabilize training.
Questions about Wasserstein distance
What is 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.
Which Manning books explain Wasserstein distance?
Learn Generative AI with PyTorch, Machine Learning Platform Engineering, Evolutionary Deep Learning: Genetic algorithms and neural networks and Machine Learning System Design.
What should I know before learning Wasserstein distance?
Manning books that teach Wasserstein distance usually introduce DCGAN / deep convolutional gan, discriminator, generative adversarial network and generator first.
What is the difference between Wasserstein distance and population stability index?
Wasserstein distance is a distance between probability distributions defined by the minimum cost of transporting probability mass between them under a specified ground distance. 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.
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.



