Giter Club home page Giter Club logo

wassersteinestimation's Introduction

Wasserstein-1 Estimation

Small Toy-Example of using the Kantorovich-Rubinstein duality of the Wasserstein-1 metric to estimate the distance between two 1D distributions. According to this duality, the Wasserstein-1 distance between two distributions P and Q is:

$$W_1(P||Q) = \underset{\lVert h \rVert_L \leq 1}{\text{sup}} \underset{x \sim P}{\mathbb{E}}[h(x)] - \underset{x \sim Q}{\mathbb{E}}[h(x)],$$

where the supremum is taken over all 1-Lipschitz functions. We estimate $h$ using a fully-connected neural network. To enforce the Lipschitz constraint, we use projected gradient descent proposed in 'Regularisation of Neural Networks by Enforcing Lipschitz Continuity' which divides each weight matrix by its spectral norm if it surpasses 1. As the Lipschitz constant of the composition of functions is smaller than the product of their individual Lipschitz constants, this ensures that our entire network is 1-Lipschitz. The same duality is also the main idea behind Wasserstein GANs, where the discriminator has the same interpretation as our function $h$.

To get an idea about the accuracy of our estimation, we can use the special formula for the $W_1$ distance between two one-dimensional distributions with CDFs $F$ and $G$:

$$ W_1(P||Q) = \int_\mathbb{R} |F(x) - G(x) |dx.$$

To evaluate this expression, we use simple numerical integration.

image

wassersteinestimation's People

Contributors

m4xim4l avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.