[MRG] Stereographic Spherical Sliced Wasserstein - #836
Open
huytransformer wants to merge 2 commits into
Open
Conversation
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
This PR aims to add the Stereographic Spherical Sliced Wasserstein distance and its rotationally invariant extension introduced in Stereographic Spherical Sliced Wasserstein Distances.
Changes:
ot.sliced.stereographic_sliced_wasserstein_spherefunction to compute the S3W distance, and the RI-S3W distance with then_rotationsargument. The amortized version ARI-S3W can be computed by pregenerating a pool of rotations withot.sliced.get_random_rotationsand passing a random subset with therotationsargument.ot.sliced.get_random_rotationsfunction to sample rotations uniformly on SO(d), used for RI-S3W.test/sliced/test_spherical_sliced.py.Motivation and context / Related issue
The S3W distances are fast alternatives to
ot.sliced_wasserstein_spherefor comparing distributions on the sphere: after a stereographic projection composed with a near-isometric map, they only require computing sliced Wasserstein distances in R^{d-1}, and they support all backends including tensorflow.How has this been tested (if it applies)
I added tests of these functions in
test/sliced/test_spherical_sliced.py.PR checklist