From 6291cdd2e509361be2bb2d2c3eb913ab2736376f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 1 Dec 2023 15:19:59 +0100 Subject: [PATCH 1/3] first shot 0.9.2 release --- RELEASES.md | 47 ++++++++++++++++++++++++++++++++++++++++++++++- ot/__init__.py | 2 +- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 3c428c521..cd04a7a7f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,6 +1,51 @@ # Releases -## 0.9.2dev +## 0.9.2 +*December 2023* + +This new release contains several new features and bug fixes. Among the new features +we have a new solver for estimation of nearest Brenier potentials (SSNB) that can be used for O mapping estimation (on small problems), new Bregman Alternated Projected Gradient solvers for GW and FGW, and new solvers for Bures-Wasserstein barycenters. Finally we have a new exact line-search for (F)GW solvers with KL loss that can be used to improve the convergence of the solvers. + +We also have a new `LazyTensor` class that can be used to model OT plans and low rank tensors in large scale OT. This class is used y the new wrapper for `geomloss` Sinkhorn solver on empirical samples that can lead to x10/x100 speedups on CPU or GPU and have a lazy implementation that allows solving very large problems of a few millions samples. + +We also have a new API for solving OT problems from empirical samples with `ot.solve_sample` Finally we have a new API for Gromov-Wasserstein solvers with `ot.solve_gromov` function that centralizes most of the (F)GW methods with unified notation. Some example of how to use the new API below: + +```python +# Generate random data +xs, xt = np.random.randn(100, 2), np.random.randn(50, 2) + +# Solve OT problem with empirical samples +sol = ot.solve_sample(xs, xt) # Exact OT betwen smaples with uniform weights +sol = ot.solve_sample(xs, xt, wa, wb) # Exact OT with weights given by user + +sol = ot.solve_sample(xs, xt, reg= 1, metric='euclidean') # sinkhorn with euclidean metric + +sol = ot.solve_sample(xs, xt, reg= 1, method='geomloss') # faster sinkhorn solver on CPU/GPU + +# Solve GW problem +Cs, Ct = ot.dist(xs, xs), ot.dist(xt, xt) # compute cost matrices +sol = ot.solve_gromov(Cs,Ct) # Exact GW between samples with uniform weights + +# Solve FGW problem +M = ot.dist(xs, xt) # compute cost matrix + +# Exact FGW between samples with uniform weights +sol = ot.solve_gromov(Cs, Ct, M, loss='KL') # FGW with KL data fitting + + +# recover solutions objects +P = sol.plan # OT plan +u, v = sol.potentials # dual variables +value = sol.value # OT value + + +``` + +Users are encouraged to use the new API but it might still be subjects to small changes before the release of POT 1.0 . +This class is used in the new BAPG solvers for GW and FGW that can be used to solve large scale OT problems with a small memory footprint. + +We also fixed a number of issues, the most pressing being a problem of GPU memory allocation when pytorch is installed that will not happen now thanks to Lazy initialization. We now also have the possibility to deactivate some backends which prvent python from importing them using environment variables. + #### New features + Added support for [Nearest Brenier Potentials (SSNB)](http://proceedings.mlr.press/v108/paty20a/paty20a.pdf) (PR #526) + minor fix (PR #535) diff --git a/ot/__init__.py b/ot/__init__.py index 9c33e9feb..24a8a06ed 100644 --- a/ot/__init__.py +++ b/ot/__init__.py @@ -56,7 +56,7 @@ # utils functions from .utils import dist, unif, tic, toc, toq -__version__ = "0.9.2dev" +__version__ = "0.9.2" __all__ = ['emd', 'emd2', 'emd_1d', 'sinkhorn', 'sinkhorn2', 'utils', 'datasets', 'bregman', 'lp', 'tic', 'toc', 'toq', 'gromov', From a5d5501db124d576cb3e030194d092ca551c3da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 Dec 2023 10:10:58 +0100 Subject: [PATCH 2/3] update release file --- RELEASES.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 85c582e53..60d574439 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -4,9 +4,9 @@ *December 2023* This new release contains several new features and bug fixes. Among the new features -we have a new solver for estimation of nearest Brenier potentials (SSNB) that can be used for O mapping estimation (on small problems), new Bregman Alternated Projected Gradient solvers for GW and FGW, and new solvers for Bures-Wasserstein barycenters. Finally we have a new exact line-search for (F)GW solvers with KL loss that can be used to improve the convergence of the solvers. +we have a new solver for estimation of nearest Brenier potentials (SSNB) that can be used for OT mapping estimation (on small problems), new Bregman Alternated Projected Gradient solvers for GW and FGW, and new solvers for Bures-Wasserstein barycenters. We also provide a first solver for Low Rank Sinkhorn that will be ussed to provide low rak OT extensions in the next releases. Finally we have a new exact line-search for (F)GW solvers with KL loss that can be used to improve the convergence of the solvers. -We also have a new `LazyTensor` class that can be used to model OT plans and low rank tensors in large scale OT. This class is used y the new wrapper for `geomloss` Sinkhorn solver on empirical samples that can lead to x10/x100 speedups on CPU or GPU and have a lazy implementation that allows solving very large problems of a few millions samples. +We also have a new `LazyTensor` class that can be used to model OT plans and low rank tensors in large scale OT. This class is used to return the plan for the new wrapper for `geomloss` Sinkhorn solver on empirical samples that can lead to x10/x100 speedups on CPU or GPU and have a lazy implementation that allows solving very large problems of a few millions samples. We also have a new API for solving OT problems from empirical samples with `ot.solve_sample` Finally we have a new API for Gromov-Wasserstein solvers with `ot.solve_gromov` function that centralizes most of the (F)GW methods with unified notation. Some example of how to use the new API below: @@ -22,6 +22,12 @@ sol = ot.solve_sample(xs, xt, reg= 1, metric='euclidean') # sinkhorn with euclid sol = ot.solve_sample(xs, xt, reg= 1, method='geomloss') # faster sinkhorn solver on CPU/GPU +sol = ot.solve_sample(x,x2, method='factored', rank=10) # compute factored OT + +sol = ot.solve_sample(x,x2, method='lowrank', rank=10) # compute lowrank sinkhorn OT + +value_bw = ot.solve_sample(xs, xt, method='gaussian').value # Bures-Wasserstein distance + # Solve GW problem Cs, Ct = ot.dist(xs, xs), ot.dist(xt, xt) # compute cost matrices sol = ot.solve_gromov(Cs,Ct) # Exact GW between samples with uniform weights @@ -30,7 +36,7 @@ sol = ot.solve_gromov(Cs,Ct) # Exact GW between samples with uniform weights M = ot.dist(xs, xt) # compute cost matrix # Exact FGW between samples with uniform weights -sol = ot.solve_gromov(Cs, Ct, M, loss='KL') # FGW with KL data fitting +sol = ot.solve_gromov(Cs, Ct, M, loss='KL', alpha=0.7) # FGW with KL data fitting # recover solutions objects @@ -38,13 +44,16 @@ P = sol.plan # OT plan u, v = sol.potentials # dual variables value = sol.value # OT value +# for GW and FGW +value_linear = sol.value_linear # linear part of the loss +value_quad = sol.value_quad # quadratic part of the loss ``` -Users are encouraged to use the new API but it might still be subjects to small changes before the release of POT 1.0 . -This class is used in the new BAPG solvers for GW and FGW that can be used to solve large scale OT problems with a small memory footprint. +Users are encouraged to use the new API (it is much simpler) but it might still be subjects to small changes before the release of POT 1.0 . + -We also fixed a number of issues, the most pressing being a problem of GPU memory allocation when pytorch is installed that will not happen now thanks to Lazy initialization. We now also have the possibility to deactivate some backends which prvent python from importing them using environment variables. +We also fixed a number of issues, the most pressing being a problem of GPU memory allocation when pytorch is installed that will not happen now thanks to Lazy initialization of the backends. We now also have the possibility to deactivate some backends using environment which prevents POT from importing them and can lead to large import speedup. #### New features From 6d6d889f7235bea4e7603898ba1b30beae6eac75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Flamary?= Date: Fri, 22 Dec 2023 10:25:34 +0100 Subject: [PATCH 3/3] update contributors --- CONTRIBUTORS.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 5cc34f38b..89c5be433 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,11 +2,16 @@ ## Creators and Maintainers -This toolbox has been created and is maintained by: +This toolbox has been created by -* [Rémi Flamary](http://remi.flamary.com/) +* [Rémi Flamary](https://remi.flamary.com/) * [Nicolas Courty](http://people.irisa.fr/Nicolas.Courty/) +It is currently maintained by + +* [Rémi Flamary](https://remi.flamary.com/) +* [Cédric Vincent-Cuaz](https://cedricvincentcuaz.github.io/) + ## Contributors The contributors to this library are: @@ -58,4 +63,4 @@ This toolbox benefit a lot from open source research and we would like to thank POT has benefited from the financing or manpower from the following partners: -ANRCNRS3IA \ No newline at end of file +ANRCNRS3IAHi!PARIS \ No newline at end of file