Skip to content
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] Nearest Brenier Potentials #526

Merged
merged 25 commits into from
Oct 11, 2023
Merged

Conversation

eloitanguy
Copy link
Collaborator

@eloitanguy eloitanguy commented Sep 21, 2023

Types of changes

  • New feature: support for Nearest Brenier Potentials (SSNB) in a new ot.mapping module, with a wrapper in ot.da and an example in the "other" category.
  • Better test coverage for ot.da (now 99%, from about 95% iirc)

Motivation and context / Related issue

There was no public implementation of SSNB

How has this been tested (if it applies)

full pytest coverage + example

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.

@eloitanguy
Copy link
Collaborator Author

eloitanguy commented Sep 21, 2023

I've added the new module ot.mapping in the documentation all.rst file, and there is a doc page for it, but with all the functions duplicated. I haven't found a difference between ot.mapping and the other modules, and haven't found much online. If anyone reading this knows why this issue happens, I'm very interested!

EDIT: created a separate issue #527

@codecov
Copy link

codecov bot commented Sep 21, 2023

Codecov Report

Merging #526 (55a9b28) into master (5ab00dd) will increase coverage by 0.26%.
The diff coverage is 97.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #526      +/-   ##
==========================================
+ Coverage   95.99%   96.26%   +0.26%     
==========================================
  Files          65       67       +2     
  Lines       13816    14040     +224     
==========================================
+ Hits        13263    13515     +252     
+ Misses        553      525      -28     

@eloitanguy eloitanguy changed the title [WIP] Nearest Brenier Potentials [MRG] Nearest Brenier Potentials Sep 21, 2023
Copy link
Collaborator

@rflamary rflamary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is great! I believe those functions are very mapping specific and do not need to appear directly in ot. but except that I think we are ready to merge. Good job @eloitanguy

ot/__init__.py Outdated
from .weak import weak_optimal_transport
from .factored import factored_optimal_transport
from .solvers import solve
from .mapping import (nearest_brenier_potential_fit, nearest_brenier_potential_predict_bounds, joint_OT_mapping_kernel,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not necessary to load them here, those are pretty specific functions (we usually only load generic functions or some that were there before)), same comment below on the lists in text

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @rflamary!, The last commit addresses your comment, and fixes the example icon. I also made the function ot.mapping._ssnb_qcqp_constants private (added the _), since a user would have no use for this helper function on its own.

@rflamary rflamary merged commit 7856700 into PythonOT:master Oct 11, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants