-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MRG] New API for OT solver (with pre-computed ground cost matrix) #388
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #388 +/- ##
==========================================
+ Coverage 94.02% 94.26% +0.23%
==========================================
Files 22 23 +1
Lines 5924 6203 +279
==========================================
+ Hits 5570 5847 +277
- Misses 354 356 +2 |
Hi @rflamary, Fantastic :-) I'd be happy to come and visit you in Saclay in September to synchronize all of this - and we can have a visio call more or less anytime in August if you're not offline. In any case, have a good summer and see you soon! |
@jeanfeydy this is great I will also work on that during the summer I think and we definitely want to talk. Especially since I changed the API a little bit and I don't really like having the same OTResult class for traditional OT problem (value+plan+...) and for OT barycenter when the result is a distribution (masses+ support position). August is fine for a virtual meeting and of course we should meetup in saclay at the beginning of the academic year (end of September the beginning will be hectic for me) |
Ok perfect, see you soon! |
I think its OK now (doc for fyunction is done exemples and example update will be done later when doing the full API V2 release). @agramfort care for a quick code reveiw? |
Co-authored-by: Alexandre Gramfort <[email protected]>
Co-authored-by: Alexandre Gramfort <[email protected]>
it would be really cool to have this new API showed early in this page https://pythonot.github.io/quickstart.html |
I agree but it is not ready yet because we need to implement also GW, OT on sample and OT on grid which is a lot of work in addition to the doc... I am going for a feature/bug 8.3 release shortly (we have many bugs in 8.2) where teh new API is not yet promoted (or only with beta status) and then we go twoard POT 1.0 with a big documentation and exemple revamp. |
Types of changes
I implement the new POT API for general OT solvers. It comes with the new function
ot.solve
that can be used to solve exact, regularized and unbalanced OT depending on the parameter it receives and returns a newOTResult
class that contains all information that can be useful to the user (OT value, OT plan, OT marginals and OT dual potentials).ot.solve
function with exact OT and exact unbalanced OTot.partial
andot.smooth
Motivation and context / Related issue
The API has been discussed with @agramfort @jeanfeydy @hichamjanati and @ncourty and aim at providing a general solver mechanism for the most common OT problems.
The code has been written in part by @jeanfeydy in an HackMD file used during the discussion.
How has this been tested (if it applies)
New tests for all possible product of parameters
PR checklist