Skip to content

0.9.0

Compare
Choose a tag to compare
@rflamary rflamary released this 07 Apr 08:32
· 96 commits to master since this release
89f1613

This new release contains so many new features and bug fixes since 0.8.2 that we decided to make it a new minor release at 0.9.0.

The release contains many new features. First we did a major update of all Gromov-Wasserstein solvers that brings up to 30% gain in
computation time (see PR #431) and allows the GW solvers to work on non symmetricmatrices. It also brings novel solvers for the veryefficient semi-relaxed GW problem that can be used to find the best re-weighting for one of the distributions. We also now have fast and differentiable solvers for Wasserstein on the circle and sliced Wasserstein on the sphere. We are also very happy to provide new OT barycenter solvers such as the Free support Sinkhorn barycenter and the Generalized Wasserstein barycenter. A new differentiable solver for OT across spaces that provides OT plans between samples and features simultaneously and called Co-Optimal Transport has also been implemented. Finally we began working on OT between Gaussian distributions and now provide differentiable estimation for the Bures-Wasserstein divergence and mappings.

Another important first step toward POT 1.0 is the implementation of a unified API for OT solvers with introduction of the ot.solve function that can solve (depending on parameters) exact, regularized and unbalanced OT and return a new OTResult object. The idea behind this new API is to facilitate exploring different solvers with just a change of parameter and get a more unified API for them. We will keep the old solvers API for power users but it will be the preferred way to solve problems starting from release 1.0.0. We provide below some examples of use for the new function and how to recover different aspects of the solution (OT plan, full loss, linear part of the loss, dual variables) :

#Solve  exact ot
sol = ot.solve(M)

# get the results
G = sol.plan # OT plan
ot_loss = sol.value # OT value (full loss for regularized and unbalanced)
ot_loss_linear = sol.value_linear # OT value for linear term np.sum(sol.plan*M)
alpha, beta = sol.potentials # dual potentials

# direct plan and loss computation
G = ot.solve(M).plan
ot_loss = ot.solve(M).value

# OT exact with marginals a/b
sol2 = ot.solve(M, a, b)

# regularized and unbalanced OT
sol_rkl = ot.solve(M, a, b, reg=1) # KL regularization
sol_rl2 = ot.solve(M, a, b, reg=1, reg_type='L2')
sol_ul2 = ot.solve(M, a, b, unbalanced=10, unbalanced_type='L2')
sol_rkl_ukl = ot.solve(M, a, b, reg=10, unbalanced=10) # KL + KL

The function is fully compatible with backends and will be implemented for different types of distribution support (empirical distributions, grids) and OT problems (Gromov-Wasserstein) in the new releases. This new API is not yet presented in the kickstart part of the documentation as there is a small change that it might change when implementing new solvers but we encourage users to play with it.

Finally, in addition to those many new this release fixes 20 issues (some long standing) and we want to thank all the contributors who made this release so big. More details below.

New features

  • Added feature to (Fused) Gromov-Wasserstein solvers herited from ot.optim to support relative and absolute loss variations as stopping criterions (PR #431)
  • Added feature to (Fused) Gromov-Wasserstein solvers to handle asymmetric matrices (PR #431)
  • Added semi-relaxed (Fused) Gromov-Wasserstein solvers in ot.gromov + examples (PR #431)
  • Added the spherical sliced-Wasserstein discrepancy in ot.sliced.sliced_wasserstein_sphere and ot.sliced.sliced_wasserstein_sphere_unif + examples (PR #434)
  • Added the Wasserstein distance on the circle in ot.lp.solver_1d.wasserstein_circle (PR #434)
  • Added the Wasserstein distance on the circle (for p>=1) in ot.lp.solver_1d.binary_search_circle + examples (PR #434)
  • Added the 2-Wasserstein distance on the circle w.r.t a uniform distribution in ot.lp.solver_1d.semidiscrete_wasserstein2_unif_circle (PR #434)
  • Added Bures Wasserstein distance in ot.gaussian (PR ##428)
  • Added Generalized Wasserstein Barycenter solver + example (PR #372), fixed graphical details on the example (PR #376)
  • Added Free Support Sinkhorn Barycenter + example (PR #387)
  • New API for OT solver using function ot.solve (PR #388)
  • Backend version of ot.partial and ot.smooth (PR #388 and #449)
  • Added argument for warmstart of dual potentials in Sinkhorn-based methods in ot.bregman (PR #437)
  • Added parameters method in ot.da.SinkhornTransport (PR #440)
  • ot.dr now uses the new Pymanopt API and POT is compatible with current
    Pymanopt (PR #443)
  • Added CO-Optimal Transport solver + examples (PR #447)
  • Remove the redundant nx.abs() at the end of wasserstein_1d() (PR #448)

Closed issues

  • Fixed an issue with the documentation gallery sections (PR #395)
  • Fixed an issue where sinkhorn divergence did not have a gradients (Issue #393, PR #394)
  • Fixed an issue where we could not ask TorchBackend to place a random tensor on GPU
    (Issue #371, PR #373)
  • Fixed an issue where Sinkhorn solver assumed a symmetric cost matrix (Issue #374, PR #375)
  • Fixed an issue where hitting iteration limits would be reported to stderr by std::cerr regardless of Python's stderr stream status (PR #377)
  • Fixed an issue where the metric argument in ot.dist did not allow a callable parameter (Issue #378, PR #379)
  • Fixed an issue where the max number of iterations in ot.emd was not allowed to go beyond 2^31 (PR #380)
  • Fixed an issue where pointers would overflow in the EMD solver, returning an
    incomplete transport plan above a certain size (slightly above 46k, its square being
    roughly 2^31) (PR #381)
  • Error raised when mass mismatch in emd2 (PR #386)
  • Fixed an issue where a pytorch example would throw an error if executed on a GPU (Issue #389, PR #391)
  • Added a work-around for scipy's bug, where you cannot compute the Hamming distance with a "None" weight attribute. (Issue #400, PR #402)
  • Fixed an issue where the doc could not be built due to some changes in matplotlib's API (Issue #403, PR #402)
  • Replaced Numpy C Compiler with Setuptools C Compiler due to deprecation issues (Issue #408, PR #409)
  • Fixed weak optimal transport docstring (Issue #404, PR #410)
  • Fixed error with parameter log=Truefor SinkhornLpl1Transport (Issue #412,
    PR #413)
  • Fixed an issue about warn parameter in sinkhorn2 (PR #417)
  • Fix an issue where the parameter stopThr in empirical_sinkhorn_divergence was rendered useless by subcalls
    that explicitly specified stopThr=1e-9 (Issue #421, PR #422).
  • Fixed a bug breaking an example where we would try to make an array of arrays of different shapes (Issue #424, PR #425)
  • Fixed an issue with the documentation gallery section (PR #444)
  • Fixed issues with cuda variables for line_search_armijo and entropic_gromov_wasserstein (Issue #445, #PR 446)

New Contributors

Full Changelog: 0.8.2...0.9.0