Skip to content

[MRG] Sliced wasserstein #203

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

Merged
merged 22 commits into from
Oct 22, 2020
Merged

[MRG] Sliced wasserstein #203

merged 22 commits into from
Oct 22, 2020

Conversation

AdrienCorenflos
Copy link
Contributor

@AdrienCorenflos AdrienCorenflos commented Jul 20, 2020

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and context / Related issue

Implement SWD: #202

How has this been tested (if it applies)

Added specific tests (positive definiteness + matching the EMD in the 1D case)

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document.
  • All tests passed, and additional code has been covered with new tests.

Not sure why yet but the stuff doesn't build.

I'm publishing this as a draft as I have some other changes in my branch that are pending for another merge (cf this: #200)

@AdrienCorenflos
Copy link
Contributor Author

It doesn't build because of the string formatting: f"stuff" which is only supported from python 3.6. You guys sure you want to support python 3.5?

@rflamary
Copy link
Collaborator

yes we keep it, we can have this discussion for the next major release but for now we still support 3.5.

Note that you have a lot of things in this PR that should not be here (and in other PR):

  • Change for sinkhorn in log (i agree for a new solver but it should be a new one, you do not change the current default)
  • Correction for the doc of barycenter (already in another PR)

@rflamary
Copy link
Collaborator

Sorry did not see the revert up there about log ;)

@AdrienCorenflos
Copy link
Contributor Author

AdrienCorenflos commented Jul 20, 2020 via email

@rflamary
Copy link
Collaborator

rflamary commented Jul 20, 2020

done and updated your PR (merged master)

@AdrienCorenflos
Copy link
Contributor Author

AdrienCorenflos commented Jul 20, 2020 via email

@AdrienCorenflos
Copy link
Contributor Author

AdrienCorenflos commented Jul 20, 2020 via email

@AdrienCorenflos
Copy link
Contributor Author

Cool, looks like it's building just fine

@AdrienCorenflos AdrienCorenflos marked this pull request as ready for review July 20, 2020 17:44
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.

Thank you very much @AdrienCorenflos for this PR.

I did a code review and found several comments below that should be addressed before merging.

Also please do the following:

  • Add the new module to the doc
  • Provide a simple example in 2D for a large number of samples of the computation of the sliced distance (maybe compute a variance as a function of the number of projection). The example should be in the folder below should follow the other examples format and will automatically be added in the documentation:
    https://github.com/PythonOT/POT/tree/master/examples/others
  • Add your name to the contributors in the Readme file and the sliced wasserstein to the list of features (with a link to the example).

Thank you again for the PR there is a little bit of work before merging but it will be a nice contribution to POT.

@AdrienCorenflos
Copy link
Contributor Author

AdrienCorenflos commented Jul 31, 2020 via email

@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2020

Codecov Report

Merging #203 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   92.28%   92.38%   +0.09%     
==========================================
  Files          15       16       +1     
  Lines        3006     3045      +39     
==========================================
+ Hits         2774     2813      +39     
  Misses        232      232              

@AdrienCorenflos
Copy link
Contributor Author

Feels like it should be good @rflamary

@AdrienCorenflos
Copy link
Contributor Author

@rflamary I think I included all your comments, do you see anything left?

@rflamary
Copy link
Collaborator

Sorry this is an hectic time on my end, I see some small comments but don't have time for a proper code review yet. Will do it asap. Only minor things remain thank you for taking into account all my comments.

@AdrienCorenflos
Copy link
Contributor Author

AdrienCorenflos commented Aug 24, 2020

Btw on the back of this I can (very) easily do the (heuristical max slice), is that something that would be of interest?

@rflamary rflamary changed the title Sliced wasserstein [WIP] Sliced wasserstein Aug 25, 2020
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.

Here are some remaining comments on the code.

yes it would be nice to also add the max sliced wasserstein. Now that you have the new muodule most of the work is done indeed.

@AdrienCorenflos
Copy link
Contributor Author

Anything else @rflamary ?

@rflamary rflamary changed the title [WIP] Sliced wasserstein [MRG] Sliced wasserstein Sep 4, 2020
@rflamary
Copy link
Collaborator

rflamary commented Sep 7, 2020

Hello,

Thank you @AdrienCorenflos . I'm OK with the PR and plan on merging it.

But the build_linux_minimal fails and I want to investigate this problem before merging. It does not come from you PR but I don't wan't to merge if the build fails.

@AdrienCorenflos
Copy link
Contributor Author

Maybe you'd want to rerun the checks?

@rflamary
Copy link
Collaborator

rflamary commented Oct 2, 2020

The problem is that if I rerun the checks they might pass but that something we have to understand and Im' pretty busy right now ;).

I promise I will merge your PR before the next release but I want to solve the mystery before pilling merges.

@codecov-io
Copy link

codecov-io commented Oct 22, 2020

Codecov Report

Merging #203 into master will increase coverage by 0.09%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #203      +/-   ##
==========================================
+ Coverage   92.28%   92.38%   +0.09%     
==========================================
  Files          15       16       +1     
  Lines        3006     3045      +39     
==========================================
+ Hits         2774     2813      +39     
  Misses        232      232              

@rflamary rflamary merged commit 78b44af into PythonOT:master Oct 22, 2020
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.

4 participants