unbalanced-partial
Use POT unbalanced and partial optimal transport solvers when masses may differ, outliers should be ignored, or only part of the mass should move.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- unbalanced-partial
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use POT unbalanced and partial optimal transport solvers when masses may differ, outliers should be ignored, or only part of the mass should move.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md9.9 KB
- 参考文档references/troubleshooting.md8.7 KB
- 参考文档references/workflows.md8.7 KB
- 脚本scripts/unbalanced_partial_smoke.py16.2 KB
03 SKILL.md 正文
POT unbalanced and partial optimal transport
Use this sub-skill when a POT task is about relaxed marginals, unequal total mass, explicit transported mass, outlier rejection, unbalanced barycenters, or regularization paths for unbalanced OT.
Route the request
- Read references/api-reference.md when choosing between
ot.unbalanced.*,ot.partial.*,ot.regpath.*, and unifiedot.solve(..., unbalanced=...)APIs or when checking signatures, return shapes, and parameter meanings. - Read references/workflows.md when implementing an end-to-end recipe: compare UOT against partial OT for outliers, stabilize entropic partial OT, build an unbalanced barycenter, use 1D helpers, or sample an L2-UOT regularization path.
- Read references/troubleshooting.md when a plan has unexpected mass,
mis infeasible,reg/reg_mare confused, a divergence name is rejected, small entropic regularization produces NaNs, or optional backend behavior is unclear. - Run scripts/unbalanced_partial_smoke.py after installing POT to check deterministic NumPy UOT/partial/barycenter/regpath behavior; the legacy
--include-optional-uot-1dflag attempts the optional autodiff-backed 1D UOT check and records a structured skip when that backend is unavailable.
Boundaries
This sub-skill owns unbalanced and partial OT semantics: sinkhorn_unbalanced, sinkhorn_unbalanced2, mm_unbalanced, lbfgsb_unbalanced, uot_1d, barycenter_unbalanced, partial_wasserstein, entropic_partial_wasserstein, partial_wasserstein_1d, unbalanced/partial GW routing notes, and ot.regpath L2-UOT paths.
Route balanced exact OT, balanced Sinkhorn basics, distance matrix construction basics, and OTResult fundamentals to core-solvers. Route detailed Gromov-Wasserstein and fused GW modeling to gromov. Route sliced high-dimensional UOT variants and Gaussian/GMM approximations to sliced-gaussian-large-scale. Route optional backend installation, batch solvers, and mixed-array backend issues to backend-and-batch.
Operating checklist
- Validate that weights are one-dimensional, nonnegative, finite, and aligned with the rows/columns of the cost matrix.
- Decide the mass model: UOT relaxes marginal constraints with
reg_m/unbalanced; partial OT fixes transported mass withm. - Scale or inspect the cost matrix before choosing
regandreg_m; the same numeric parameters mean different things after cost rescaling. - Validate the returned plan: shape
(len(a), len(b)), finite nonnegative entries, transported mass, and row/column sums appropriate to UOT or partial constraints. - For entropic partial OT at small
reg, prefermethod="sinkhorn_log"and confirm finite output plusplan.sum() ≈ m.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).