Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MMSinkhorn solver #549

Merged
merged 26 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -e".[test]"
python3 -m pip install "jax[cuda12_local]" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html
python3 -m pip install "jax[cuda12]"

- name: Run nvidia-smi
run: |
Expand Down
11 changes: 11 additions & 0 deletions docs/experimental/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
ott.experimental
================
.. module:: ott.experimental

The :mod:`ott.experimental` module groups experimental code that might be useful
for users but whose API we expect to change significantly in coming months.

.. toctree::
:maxdepth: 2

mmsinkhorn
15 changes: 15 additions & 0 deletions docs/experimental/mmsinkhorn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ott.experimental.mmsinkhorn
===========================
.. module:: ott.experimental.mmsinkhorn
.. currentmodule:: ott.experimental.mmsinkhorn

Solvers for multimarginal entropic OT problems, defined using :math:`k` point
clouds of variable sizes in dimension :math:`d`.

Sinkhorn Initializers
---------------------
.. autosummary::
:toctree: _autosummary

MMSinkhorn
MMSinkhornOutput
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ Packages
solvers/index
initializers/index
neural/index
experimental/index
tools
math
utils
Expand Down
26 changes: 26 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ @article{cuturi:15
year = {2016},
}


@inproceedings{piran:24,
author = {Piran, Zoe and Klein, Michal and Thornton, James and Cuturi, Marco},
publisher = {PMLR},
booktitle = {Proceedings of The 41st International Conference on Machine Learning},
month = jun,
series = {Proceedings of Machine Learning Research},
title = {Contrasting Multiple Representations with the Multi-Marginal Matching Gap},
year = {2024},
}



@inproceedings{peyre:16,
author = {Peyré, Gabriel and Cuturi, Marco and Solomon, Justin},
editor = {Balcan, Maria Florina and Weinberger, Kilian Q.},
Expand Down Expand Up @@ -356,6 +369,19 @@ @article{solomon:15
year = {2015},
}


@article{gangbo:98,
author = {Gangbo, Wilfrid and Święch, Andrzej},
title = {Optimal maps for the multidimensional Monge-Kantorovich problem},
journal = {Communications on Pure and Applied Mathematics},
volume = {51},
number = {1},
pages = {23-45},
year = {1998}
}



@inproceedings{genevay:18,
author = {Genevay, Aude and Peyre, Gabriel and Cuturi, Marco},
editor = {Storkey, Amos and Perez-Cruz, Fernando},
Expand Down
2 changes: 2 additions & 0 deletions docs/spelling/technical.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ linearized
logit
macOS
methylation
multimarginal
neuroimaging
normed
numerics
Expand All @@ -100,6 +101,7 @@ parameterization
parameterizing
piecewise
pluripotent
polymatching
polynomials
positivity
postfix
Expand Down
17 changes: 5 additions & 12 deletions docs/tutorials/Sinkhorn_Barycenters.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"id": "C4nZjbMHWcm_"
},
"source": [
"# Sinkhorn Barycenters"
"# Sinkhorn Barycenters\n",
"\n",
"This tutorial covers the computation of Wasserstein barycenters using regularized OT, based on {cite}`cuturi:14` and {cite}`benamou:15`."
]
},
{
Expand Down Expand Up @@ -56,20 +58,11 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"id": "ysURew0UKhHE"
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/michal/mambaforge/envs/ott/lib/python3.10/site-packages/nilearn/datasets/struct.py:850: UserWarning: `legacy_format` will default to `False` in release 0.11. Dataset fetchers will then return pandas dataframes by default instead of recarrays.\n",
" warnings.warn(_LEGACY_FORMAT_MSG)\n"
]
}
],
"outputs": [],
"source": [
"n_subjects = 4\n",
"dataset_files = datasets.fetch_oasis_vbm(\n",
Expand Down
1 change: 1 addition & 0 deletions docs/tutorials/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Linear Optimal Transport
OTT_&_POT
Hessians
LRSinkhorn
mmsink
sinkhorn_divergence_gradient_flow
sparse_monge_displacements

Expand Down
158 changes: 158 additions & 0 deletions docs/tutorials/mmsink.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/ott/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from . import (
datasets,
experimental,
geometry,
initializers,
math,
Expand Down
14 changes: 14 additions & 0 deletions src/ott/experimental/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright OTT-JAX
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from . import mmsinkhorn
Loading
Loading