-
Notifications
You must be signed in to change notification settings - Fork 528
[MRG] add screenkhorn: screening Sinkhorn algorithm #121
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mzalaya,
Thank you for your PR. I think screenkhorn has its place in POT. I have several comments that should be taken care of before marge. Note that i don't want to add new dependencies so you should code your function to work with numpy if bottleneck is not installed (and use bottleneck if installed).
You will also need to respect pep8. you can do an automatic autopep8 with make aautopep8
in the POT main folder.
Finally you need to check that all tests are passing and you need to write tests to check that your function runs without bugs and return a meaningful solution in test/test_bregman.py
Welcome to the POT contributors
add Exception at the beginning to check the installation of bottleneck module
Hello @mzalaya, I see you have implemented a lot of our comments and the code is shaping up very well. There is still the binary indexing that needs to be looked at and I would also like you to add an example of you solver in the example folder of the repository. The examples are afterwards included semi automatically in the documentation with the plots and everything and it will definitely make your new contribution more visible. Also we need some tests on the new function that i don't see running in travis yet. I triggered the build for your last commit to see if the tests pass. I don't know why it did not trigger itself (spoiler alert it failed because of pep8 violations). |
Hello @mzalaya, We are nearly there. What is still missing before merge:
|
@rflamary I think |
ot/bregman.py
Outdated
try: | ||
import bottleneck | ||
except ImportError: | ||
print("Bottleneck module doesn't exist. Install it from https://pypi.org/project/Bottleneck/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function should not fail when bottleneck is not installed and it will because it uses bottleneck afterwards. As already said we don't want to add dependencies.
i would do something like
try:
 import bottleneck
except ImportError:
warning("Bottleneck module is not installed. Install it from https://pypi.org/project/Bottleneck/ for better performance")
bottleneck=np
this would use the numpy partition that is not as efficient but works on any numpy machine. I'm surprise the test passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good suggestion to sent a warning for non installed Bottelenck module.
Hello @mzalaya, So now autograd breaks on python 2.7. While we could deactivate the tests on 2.7 (it is deprecated) is would like to force to use an older version of pymanopt for the tests. for that i think we can change the line
Could you try to do that please? We will remove support for 2.7 at a future date but this is another PR ;) |
@rflamary |
No description provided.