[MRG] Warmstart with dual potentials for exact OT solver#793
[MRG] Warmstart with dual potentials for exact OT solver#793rflamary merged 6 commits intoPythonOT:masterfrom
Conversation
…omputed potentials from sinkhorn or even related simplex
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #793 +/- ##
=======================================
Coverage 96.76% 96.76%
=======================================
Files 107 107
Lines 22249 22282 +33
=======================================
+ Hits 21529 21562 +33
Misses 720 720 🚀 New features to boost your workflow:
|
904aeda to
f4ef361
Compare
rflamary
left a comment
There was a problem hiding this comment.
Hello @nathanneike ,
It would be nice that you also provide a few computation times in the description of the PR so that we have an idea of the speedup when using warm start.
Note that potentials_init was used for warm start in ot.solve and you should use this same also in emd.
I would also like that you update ot.solve and ot.solve_sample to pass the warmstart to emd.
few other comments below
ot/lp/_network_simplex.py
Outdated
| check_marginals: bool, optional (default=True) | ||
| If True, checks that the marginals mass are equal. If False, skips the | ||
| check. | ||
| warmstart_dual: tuple of two arrays (alpha, beta), optional (default=None) |
There was a problem hiding this comment.
added to doc but not in teh function params and the call no?
There was a problem hiding this comment.
dont get this one they are there, I use them later to set alpha and beta init
| G_warm, log_warm = ot.emd(a, b, M, log=True, warmstart_dual=(u_partial, v_partial)) | ||
|
|
||
| # cold-start reference | ||
| G_cold, log_cold = ot.emd(a, b, M, log=True) |
There was a problem hiding this comment.
also ad emd2 (which was missing)
…omputed potentials from sinkhorn or even related simplex
Types of changes
Add Warmstart intialisation to the simplex solver allows us to give good potentials to our solvers and get why faster to solution with less iterations.
Motivation and context / Related issue
This change allows us to warmstart with potentials from other solvers. Instead of using normal initial pivots to create a Tree. We use the given potential to create a first feasible solution in our Simplex. If given potentials are good potential for big speedup. Still need to compute all Reduce Costs at least once which means that the running time for the warmstart can be big for big problems so should be done with good potentials and not just any potentials.
How has this been tested (if it applies)
Added a test for verifying correctness.
Speedup for exact potentials from an exact solve is around 3x and using good sinkhorn potentials 1.4x.
PR checklist