[MRG] Faster gromov-wasserstein linesearch for symmetric matrices by KrzakalaPaul · Pull Request #607 · PythonOT/POT

Types of changes

Add a new argument "symmetric" to ot.gromov._gw.solve_gromov_linesearch. The default value symmetric=False results in the previous behaviour. When C1 and C2 are symmetric however, one can set symmetric=True which results in faster computations as the formula can be simplified in that case.

ot.gromov._gw.fused_gromov_wasserstein and ot.gromov._gw.gromov_wasserstein have been changed accordingly to automatically pass symmetric=False or symmetric=True to solve_gromov_linesearch.

A new file symmetric_linesearch.py has been added to examples.gromov to check the usefullness of setting symmetric=True.

Motivation and context / Related issue

The formula for solving the gromov linesearch can be simplified in the (very common case) where the matrices C1 and C2 are symmetric, resulting in a small (but free) improvement in computationnal cost.

How has this been tested (if it applies)

PR checklist

  • I have read the CONTRIBUTING document.
  • The documentation is up-to-date with the changes I made (check build artifacts).
  • All tests passed, and additional code has been covered with new tests.
  • I have added the PR and Issue fix to the RELEASES.md file.