How to calculate the first Wasserstein distance between two distributions?

How to calculate the first Wasserstein distance between two distributions?

Compute the first Wasserstein distance between two 1D distributions. This distance is also known as the earth mover’s distance, since it can be seen as the minimum amount of “work” required to transform u into v, where “work” is measured as the amount of distribution weight that must be moved, multiplied by the distance it has to be moved.

Which is the first Wasserstein distance between U and V?

The first Wasserstein distance between the distributions u and v is: where Γ ( u, v) is the set of (probability) distributions on R × R whose marginals are u and v on the first and second factors respectively. If U and V are the respective CDFs of u and v, this distance also equals to:

How to approximate the Wasserstein distance with PyTorch?

In the simpler case where we only have observed variables x x (say, images of cats) coming from an unknown distribution p ( x) p ( x), we’d like to find a model q ( x | θ) q ( x | θ) (like a neural network) that is a good approximation of p ( x) p ( x).

Can you calculate KL divergence of discrete distributions?

Consider the following discrete distributions: The KL divergence assumes that the two distributions share the same support (that is, they are defined in the same set of points), so we can’t calculate it for the example above.

What is the distance function of the Wasserstein metric?

Distance function defined between probability distributions. In mathematics, the Wasserstein distance or Kantorovich – Rubinstein metric is a distance function defined between probability distributions on a given metric space. M {displaystyle M} .

How is the Wasserstein metric used in Gan?

In their paper ‘Wasserstein GAN’, Arjovsky et al. use the Wasserstein-1 metric as a way to improve the original framework of Generative Adversarial Networks (GAN), to alleviate the vanishing gradient and the mode collapse issues. The special case of normal distributions is used in a Frechet Inception Distance.