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 Linear Circular OT distance (with uniform measure on the circle as reference measure) introduced in LCOT: Linear Circular Optimal Transport
and its sliced counterpart introduced in Linear Spherical Sliced Optimal Transport: A Fast Metric for Comparing Spherical Data
.
Changes:
ot.solver_1d.linear_circular_embedding
andot.solver_1d.linear_circular_ot
functions to compute the Linear Circular OT distance.ot.sliced.linear_sliced_wasserstein_sphere
function to compute its sliced counterpart.ot.sliced.get_projections_sphere
andot.sliced.projection_sphere_to_circle
.test/test_1d_solver
andtest/test_sliced
.plot_compute_wasserstein_circle.py
ot.wasserstein_circle
to always useot.solver_1d.binary_search_circle
for any p, which seems to give better results even for p=1.plot_ssw_unif_torch.py
.Motivation and context / Related issue
The Linear Circular OT distance with uniform measure on the circle is very fast to compute, as the OT maps can be computed in closed-forms. It is thus faster to compute than the true wasserstein distance on the circle.
How has this been tested (if it applies)
I added tests of these functions in
test/test_1d_solver
andtest/test_sliced
.PR checklist