Implementations of the algorithms in the paper Approximative Algorithms for Multi-Marginal Optimal Transport and Free-Support Wasserstein Barycenters (von Lindheim, 2022). If you only want to solve the corresponding barycenter problem, see also this repository.
Using the emd
OT solver from the Python Optimal Transport (POT) package, which is a wrapper of this network simplex solver, which, in turn, is based on an implementation in the LEMON C++ library.
- Download the code or clone the Github repository with
git clone https://github.com/jvlindheim/mot.git
- For the code in
mot.py
, there is the following dependencies:numpy
,matplotlib.pyplot
, thecdist
function fromscipy.spatial.distance
and theemd
function from the POT library. You can install them e.g. using pip via
pip install --user numpy scipy matplotlib POT
If you want to run the demo notebook, you will also need to have Jupyter Notebook or JupyterLab installed.