[MRG] Fix proximal batch plan weighting - #843
Closed
ANONYMOUSZED-beep wants to merge 1 commit into
Closed
Conversation
Collaborator
|
Hello @ANONYMOUSZED-beep , I'm closing this PR since it was fixed in #844 and it now has some conflicts. |
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
Motivation and context / Related issue
Closes #842.
proximal_bregman_log_plan_batchdocumented the proximal subproblem with the termC - inner_reg * log(T), but constructed both the iterative andlast_stepkernels withC + inner_reg * log(T). That inverted the previous transport plan instead of weighting the next kernel by it.This changes both paths to:
The docstring now uses the same formula. The regression tests use a 2x2 log cross-ratio, where row and column Sinkhorn scalings cancel, to directly verify the recurrence for the ordinary and differentiable final steps.
The existing unregularized batch tests now compare feasibility and objective values rather than a specific exact-OT plan, since exact plans need not be unique. They also use a convergence-appropriate proximal coefficient for the corrected recurrence; regularized cases retain their elementwise plan comparisons and prior coefficient.
How has this been tested
0instead of expected6.python -m pytest -q test_solve_batch_issue842.py --no-cov -o addopts=: 75 passed (completetest/batch/test_solve_batch.py, NumPy and Torch backends available).pre-commit run --files ot/batch/_utils.py test/batch/test_solve_batch.py RELEASES.md: passed (Ruff lint, Ruff preview lint, Ruff format, codespell).git diff --check: passed.The tests ran on Python 3.13 using the official POT 0.9.7 Windows wheel for compiled extensions with the changed pure-Python batch module overlaid. A local editable source build was unavailable because this Windows host does not have MSVC; repository CI will exercise the normal source build.
PR checklist
RELEASES.md.