Skip to content

tvayer/SGW

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SGW

Python3 implementation of the paper Sliced Gromov-Wasserstein (NeurIPS 2019)

Sliced Gromov-Wasserstein is an Optimal Transport discrepancy between measures whose supports do not necessarily live in the same metric space. It is based on a closed form expression for 1D measures of the Gromov-Wasserstein distance (GW) [2] that allows a sliced version of GW akin to the Sliced Wasserstein distance. SGW can be applied for large scale applications (about 1s between two measures of 1 millions points each on standard GPU) and can be easily plugged into a deep learning architecture.

Feel free to ask if any question.

If you use this toolbox in your research and find it useful, please cite SGW using the following bibtex reference:

@incollection{vay2019sgw,
title = {Sliced Gromov-Wasserstein},
author = {{Vayer}, Titouan and {Flamary}, R{\'e}mi and {Tavenard}, Romain and
 {Chapel}, Laetitia and {Courty}, Nicolas},
booktitle = {Advances in Neural Information Processing Systems 32},
year = {2019}
}

Prerequisites

For examples with RISGW:

What is included ?

  • SGW function both in CPU and GPU (with Pytorch):

  • Entropic Gromov-Wasserstein in Pytorch.

  • Runtimes comparaison with Gromov-Wasserstein of POT, Entropic Gromov-Wasserstein, e.g to calculate all runtimes (in expe_paper folder):

python3 runtime.py -p '../res' -ln 200 500 1000  -pr 10 20

To plot the results (in expe_paper folder):

python plot_runtimes.py -p '../res/runtime_2019_10_16_14_26_32/'
  • A demo notebook:

  • An example of optimization on the Stiefel manifold for computing RISGW. This implementation is a CPU implementation using autograd and is not efficient for large scale applications (in expe_paper folder):

python run_rot_scale.py 

What will be added ?

  • Some works on RISGW for larger applications.
  • Integration of SGW in the POT library [1]

Authors

References

[1] Flamary Rémi and Courty Nicolas POT Python Optimal Transport library

[2] Facundo Mémoli Gromov–Wasserstein Distances and the Metric Approach to Object Matching

About

Code for Sliced Gromov-Wasserstein

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published