[WIP] Wrapper for OT barycenter solvers with free support #730
Open
cedricvincentcuaz wants to merge 29 commits intoPythonOT:masterfrom
Open
[WIP] Wrapper for OT barycenter solvers with free support #730cedricvincentcuaz wants to merge 29 commits intoPythonOT:masterfrom
cedricvincentcuaz wants to merge 29 commits intoPythonOT:masterfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #730 +/- ##
==========================================
- Coverage 96.87% 96.82% -0.06%
==========================================
Files 113 113
Lines 23062 23285 +223
==========================================
+ Hits 22342 22546 +204
- Misses 720 739 +19 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Types of changes
creation of the class
ot.utils.BaryResultextendingOTResultLong term objectives: Wrap all barycenter solvers available in POT and more, ideally establishing links between these wrappers and those for inner OT solvers ot.solve_sample, ot.solve, and ot.solve_gromov - respectively associated with their barycenter solver ot.solve_bary_sample (free support); ot.solve_bary (free masses); ot.solve_bary_gromov (free joint support)
a)
ot.solvers.bary_free_supportsystematically optimizes the support of the barycenter using BCD with closed forms. Only metrics in ('sqeuclidean', 'euclidean') are supported for now. The solver calls an hidden function_bary_sample_bcd.b) handle variations in masses across OT problems only for unbalanced problems - keeping masses unchanged for exact and inexact sinkhorn like solvers - via parameter
update_massesinot.solvers._bary_sample_bcd.c) Handle given initialization of transport plans & potentials + warmstart strategies : added parameter
warmstarttobary_sample, and based on the requested inner solver, we pick the adequate strategywarmstart_planorwarmstart_potentialspassed to_bary_sample_bcd.d) Options for stopping criterion between losses and barycenter variations: added parameter
stopping_criterionin ('loss', 'bary') passed to_bary_sample_bcd.Extensions let for future works:
lst_method_lazy(in ot.solvers)How has this been tested (if it applies)
test.test_solvers.assert_allclose_bary_solmethod to compare solutions asBaryResultobjects.test_solve_bary_samplegrid across all available barycenter solvers depending on those available inot.solvers.solve_sample.test_solve_bary_sample_NotImplementedtest error messages for methods not implemented yet.PR checklist