Skip to content

[MRG] Sliced OT Plans#767

Merged
rflamary merged 76 commits into
PythonOT:masterfrom
eloitanguy:dev_sliced_plans
Jun 2, 2026
Merged

[MRG] Sliced OT Plans#767
rflamary merged 76 commits into
PythonOT:masterfrom
eloitanguy:dev_sliced_plans

Conversation

@eloitanguy

@eloitanguy eloitanguy commented Oct 7, 2025

Copy link
Copy Markdown
Collaborator

Types of changes

Note: this PR continues #757 which was merged by accident.

Implements min-Pivot Sliced Plans Mahey et al., Tanguy et al. and Expected Sliced Plans Liu et al., Tanguy et al., and Generalised Sliced Wasserstein Plans Chapel et al..

Checklist:

  • update PR number in RELEASES.md and README.md
  • implement min-Pivot Sliced
  • implement Expected Sliced: todo: raise error when using tf or jax, test accordingly, and add a warning in the doc
  • example
  • testing (min-Pivot Sliced and Expected Sliced)
  • discuss API choices
  • Generalised SW plans implementation + example
  • doc proofreading (min-Pivot Sliced and Expected Sliced)

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.

@codecov

codecov Bot commented Oct 7, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.30986% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.81%. Comparing base (fc0820c) to head (ba2c5fb).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #767      +/-   ##
==========================================
+ Coverage   96.78%   96.81%   +0.02%     
==========================================
  Files         118      124       +6     
  Lines       23891    24234     +343     
==========================================
+ Hits        23122    23461     +339     
- Misses        769      773       +4     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clbonet clbonet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice PR @eloitanguy @lchapel!
Here are few comments.

Comment thread ot/lp/solver_1d.py Outdated
Comment thread ot/lp/solver_1d.py Outdated
Comment thread ot/sliced/_sliced_distances.py Outdated
Comment thread ot/sliced/_sliced_distances.py Outdated
Comment thread ot/sliced/_sliced_plans.py Outdated
Comment thread ot/sliced/_sliced_plans.py
Comment thread ot/sliced/_sliced_plans.py
Comment thread ot/sliced/_sliced_plans.py
Comment thread ot/utils.py
Comment thread test/test_sliced.py Outdated
@rflamary rflamary requested a review from clbonet May 29, 2026 14:37

@clbonet clbonet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lchapel for the last commits! The code looks good to me. I just have a remark on the name and shape of directions

Comment thread ot/sliced/_sliced_plans.py Outdated
Comment thread ot/sliced/_sliced_plans.py Outdated
Comment thread ot/sliced/_sliced_plans.py Outdated

@rflamary rflamary left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello thanks @eloitanguy and @lchapel

the PR is looking very good, but i'm not convinced by the name of the main functions. since they all return plans they should have plan in the name. Final min pivot is not widely used and will not be understood by the users, I suggested something below but I'm open to suggestions (probably better to discuss on slack) ;).

Comment thread ot/sliced/_sliced_plans.py Outdated
return plans, nx.stack(costs)


def min_pivot_sliced(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def min_pivot_sliced(
def min_lifted_sliced_plan(

not sure about this one but min pivot is no clear enough for the users.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lifted_sliced is another concept in our paper, maybe we could call this function min_pivot_sliced_plan?

Comment thread ot/sliced/_sliced_plans.py Outdated
return plan, cost


def expected_sliced(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def expected_sliced(
def expected_sliced_plan(

@rflamary rflamary changed the title [WIP] Sliced OT Plans [MRG] Sliced OT Plans Jun 2, 2026
@rflamary rflamary merged commit 394f3e1 into PythonOT:master Jun 2, 2026
17 checks passed
@eloitanguy eloitanguy mentioned this pull request Jun 2, 2026
4 tasks
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.

4 participants