[WIP] Add a stablized function entropic_partial_wasserstein_logscale#724
[WIP] Add a stablized function entropic_partial_wasserstein_logscale#724wzm2256 wants to merge 5 commits into
Conversation
ot.partial. This function solves the same problem as entropic\_partial\_wasserstein but is computed in logscale, so it is more robust. 2. Test exampless are provided in compare_logscale_POT.py. Test data is in data\entropic_partial_OT_cost.txt
|
Hello @wzm2256 and thanks for the PR we are indeed missing a stabilized partial entropic ot solver. When we add a stabilized solver, we usually add the function and make the original function as a wrapper when we add the log implementation (see how it is done for function ot.sinkhorn ) so that with an additional parameter Finally your example is nice we usually try to add a visualization and we really try not to add raw data to the git. Could you design a simulated example instead of a new dataset? Thanks again for your work, we will do a proper code review as soon as possible but wold prefer to do that after the comments above are taken into account. |
|
Sure! I will work on that. |
|
Hello @wzm2256 , quick reminder that we are waiting for a few changes here. |
|
I tested the current implementation, for some reason its extremely slow at the first iteration itself. |
Two planning artefacts so the next session does not have to rebuild this context cold: paper/outline.md — 7 headline claims for an Insights from Negative Results / OTML workshop preprint. Every claim links to its evidence JSON or test. Two negative results (Sinkhorn loses to Hungarian across all ε / framings; Oklch pool aug hurts Sinkhorn) and two positive ones (log-domain numerical stability; Oklch pool aug improves Hungarian) are framed honestly, not buried. Limitations, discussion mechanism argument, and reproducibility checklist are sketched. notes/pot-pr-724-rescue.md — investigation of PythonOT/POT#724 (entropic_partial_wasserstein_logscale, [WIP] since 2025-03, mergeable=CONFLICTING since 2025-09). The author self-flagged "I do not know how to use pytest" as the blocker; this repo's test_matching.py §numerical-stability scaffolding maps onto exactly that gap. The note records a 9-step rescue plan and the co-authorship proposal text to send to @wzm2256 and @rflamary. Execution is gated on R14 user sign-off (PROGRESS row 21).
…escue patch
Phase 3 tightened to N=8 seeds × N=4 targets = 32 paired runs per
condition. Both Phase-3 signs hold and CIs narrow:
hungarian_no_aug 0.4990 ± 0.031 baseline
hungarian_oklch_aug 0.5255 ± 0.022 Δ +0.0264 [+0.018, +0.036] BEATS
sinkhorn_no_aug 0.4717 ± 0.041 baseline
sinkhorn_oklch_aug 0.4295 ± 0.042 Δ -0.0421 [-0.047, -0.037] WORSE
Snapshot: experiments/results/phase3_baseline_tight_2026-05-16.json.
Figures:
paper/figures/fig_paired_ci.{pdf,png} Phase-2 ε sweep CIs (left)
+ Phase-3 oklch-aug split CIs
(right), side-by-side.
paper/figures/fig_L_preservation.{pdf,png} Per-pixel ΔL* histogram
across the default Oklch
rotation schedule on a
real image. max|ΔL*| ≤ 0.01.
Both regenerable via the make_*.py scripts next to them.
paper/preprint.md — full draft of the Insights/OTML/arXiv preprint
from paper/outline.md (≤ 8-page workshop length, 9 sections + 2
appendices). Every numeric claim cites a JSON snapshot or test path.
paper/outline.md — venue deadline survey added (2026-05-16):
- ICBINB 2026: deadline Jan 31 2026 — MISSED.
- Insights from Negative Results in NLP @ EMNLP 2026: workshop
Oct 22-29 Budapest; CFP TBA.
- OTML @ NeurIPS 2026: not yet announced.
- Plan-of-record: arXiv first, then Insights@EMNLP when CFP opens.
notes/pot-pr-724-rescue.patch — local rescue of PythonOT/POT#724
built on /tmp/POT (not pushed). Single commit, 5 files changed,
+371/−8 lines. 17/17 partial-OT tests pass on the rescue branch.
Fork + push + PR comment remain R14-gated.
PROGRESS.md — rows 20–27 brought up to date; 20 and 21 are now ◐
(local prep done, external push gated on user sign-off).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@wzm2256 @rflamary @cedricvincentcuaz — hello! I'm a downstream user of Why a separate PR instead of pushing here: I'm happy to do whichever you prefer:
Either way, the goal is to get the function in so issue #723 closes. Let me know which path you want. |
add a new function called entropic_partial_wasserstein_logscale to ot.partial. This function solves the same problem as entropic_partial_wasserstein but is computed in logscale, so it is more robust.
Test exampless are provided in compare_logscale_POT.py. Test data is in data\entropic_partial_OT_cost.txt
Types of changes
I implement a new function
entropic_partial_wasserstein_logscalethat solves exactly the same problem as the one inentropic_partial_wassersteinin log scale. The new function is a line-to-line translation of the old one, and the input/output format is exactly the same.I do not remove the old function because the new function can be slower due to the use of the logsumexp trick. So when there is no Nan error, the old function is favored.
Motivation and context / Related issue
#723
How has this been tested (if it applies)
I test the new function
entropic_partial_wasserstein_logscaleagainst the old oneentropic_partial_wassersteinin the example file 'compare_logscale_POT.py` for both numpy and pytorch.PR checklist
I could not build the document in my laptop due to some errors:
so I am not completely sure whether the document is fine, although I only added a few sentences to the docs.
Also, I do not know how to use pytest to test my code. If this is necessary, I may need some help here.