This github repository contains the code used for the experiment on Gaussian Mixture in the paper "A User's Guide to Sampling Strategies for Sliced Optimal Transport".
To compute the Sliced Wasserstein distance, the library Python Optimal Transport is needed: POT library
Other functions come from the scipy library.
Regarding the requirements for the code used in the ICML2024 paper: "Sliced-Wasserstein Estimation with Spherical Harmonic as Control Variates", Rémi Leluc, Aymeric Dieuleveut, François Portier, Johan Segers and Aigerim Zhuman. Paper, please see the following repositories: SHCV repository, Spherical Harmonics.
In the folder testSW
, you can run the following command:
python3 run_python_scripts.py
to run all the methods. Otherwise choose a file with format name test_*.py
to run.
Accordingly the ouputs are generated in a npy format to be directly used for plotting.
The scripts generated_gaussian_toys.py
and compute_ground_truths.py
should only be ran to generate new data and new ground truths (true SW). Be aware that the second script has a long computation time (~5 days).
To avoid unecessary computation time, the s-Riesz configuration points are already pre-computed and stored in npy format.