Skip to content

[MRG] Stereographic Spherical Sliced Wasserstein - #836

Open
huytransformer wants to merge 2 commits into
PythonOT:masterfrom
huytransformer:s3w
Open

[MRG] Stereographic Spherical Sliced Wasserstein#836
huytransformer wants to merge 2 commits into
PythonOT:masterfrom
huytransformer:s3w

Conversation

@huytransformer

Copy link
Copy Markdown

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:

  • Added the ot.sliced.stereographic_sliced_wasserstein_sphere function to compute the S3W distance, and the RI-S3W distance with the n_rotations argument. The amortized version ARI-S3W can be computed by pregenerating a pool of rotations with ot.sliced.get_random_rotations and passing a random subset with the rotations argument.
  • Added the ot.sliced.get_random_rotations function to sample rotations uniformly on SO(d), used for RI-S3W.
  • Added tests for these functions in test/sliced/test_spherical_sliced.py.

Motivation and context / Related issue

The S3W distances are fast alternatives to ot.sliced_wasserstein_sphere for 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

  • 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.

@rflamary
rflamary requested a review from clbonet August 6, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant