Skip to content
Back to skills

Gromov

ASecurity

"Use POT Gromov-Wasserstein and Fused GW solvers for graphs,

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
testingrustnodeapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill gromov --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gromov?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gromov
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-gromov/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-gromov)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gromov
description: "Use POT Gromov-Wasserstein and Fused GW solvers for graphs,
  structured data, heterogeneous spaces, GW barycenters, dictionary learning,
  quantized approximations, and validation."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# POT Gromov-Wasserstein and Fused GW

Use this sub-skill when the task involves comparing or aligning objects whose samples live in different metric spaces or have graph/relational structure: Gromov-Wasserstein (GW), Fused Gromov-Wasserstein (FGW), structured graph matching, node-feature-aware graph comparison, GW/FGW barycenters, dictionary learning/unmixing, semirelaxed/partial/unbalanced variants, quantized approximations, and GW validation.

Read [references/api-reference.md](references/api-reference.md) when choosing a POT GW API, checking verified signatures/defaults, understanding `ot.solve_gromov` versus `ot.gromov.*`, or validating expected plan/log/result fields.

Read [references/workflows.md](references/workflows.md) when building an end-to-end GW or FGW workflow for graphs, node features, heterogeneous spaces, barycenters, dictionary learning, or approximate/quantized GW.

Read [references/troubleshooting.md](references/troubleshooting.md) when cost matrices, weights, `loss_fun`/`loss`, `alpha`, marginal constraints, `symmetric`, partial/semirelaxed/unbalanced semantics, convergence, quantized helpers, or optional GNN dependencies fail.

Run [scripts/gromov_smoke.py](scripts/gromov_smoke.py) after installing POT to exercise deterministic NumPy GW and FGW fixtures with no plotting, downloads, original checkout, or optional graph dependencies.

## Route quickly

- Use **GW** when each object is represented only by an internal structure matrix (`C1`, `C2`), such as pairwise graph distances, adjacency-derived dissimilarities, shape geodesics, or relational similarities.
- Use **FGW** when structures also have cross-space attributes or node features. Provide a feature cost matrix `M` of shape `(n_source, n_target)` and tune `alpha`: `0` emphasizes features/linear OT and `1` emphasizes pure GW structure.
- Use **`ot.solve_gromov`** for a unified `OTResult` with `.plan`, `.value`, `.value_linear`, `.value_quad`, and marginal helpers. Use **`ot.gromov.*`** functions when you need a specific classical, entropic, semirelaxed, partial, quantized, barycenter, dictionary, or estimator API.
- Use **entropic GW/FGW** when exact conditional-gradient plans are too slow or too sparse and a smoother approximation is acceptable.
- Use **semirelaxed GW/FGW** when the source marginal is fixed but the target-side mass may be reweighted, for example matching a graph to a prototype or community structure.
- Use **partial GW/FGW** when only a known amount of mass should match, such as subgraph matching with outliers.
- Use **fused unbalanced GW** when marginal masses should be penalized rather than enforced. Route general unbalanced/partial OT fundamentals to `unbalanced-partial`.
- Use **quantized, sampled, pointwise, or low-rank GW** when graph/sample sizes make full GW too expensive; validate the approximation on a reduced problem before trusting ranking or downstream decisions.
- Use **GW/FGW barycenters** when the output is itself a structure matrix or an attributed graph prototype. Route ordinary Wasserstein barycenters to `barycenters`.
- Use **dictionary learning/unmixing** when many structured samples should be represented as convex combinations of learned GW/FGW atoms.
- Treat **POT GNN layers** (`ot.gnn`) as optional reference-only functionality unless the user's environment has PyTorch and PyTorch Geometric installed and verified. Route backend installation and batch-array issues to `backend-and-batch`.

## Stay in scope

This sub-skill owns structured GW/FGW modeling, solver selection, validation, and workflow-specific recovery. It does not cover ordinary vector-space OT except as the `M` term inside FGW; route those tasks to `core-solvers`. It does not teach general mass-relaxation theory outside GW/FGW; route that to `unbalanced-partial`. It does not install optional backend stacks, PyTorch Geometric, plotting, NetworkX, or scikit-learn; route setup questions to `backend-and-batch` or keep them explicitly optional.

## Minimal operating checklist

1. Build finite floating-point square structure matrices `C1` and `C2`; normalize scales when comparing multiple costs.
2. If using FGW, build `M` with shape `(C1.shape[0], C2.shape[0])` from comparable node-feature distances.
3. Set one-dimensional nonnegative weights `p` and `q` whose lengths match the structure matrices, or let POT use uniform weights.
4. Choose the mass model: balanced GW/FGW, semirelaxed target reweighting, partial transported mass, or unbalanced marginal penalty.
5. Run the solver with explicit `loss_fun`/`loss`, `alpha`, `reg`, `symmetric`, `max_iter`, and `tol` when reproducibility matters.
6. Validate the returned plan: finite nonnegative values, expected shape, total mass, row/column marginal behavior for the selected mass model, and a finite GW/FGW value.
7. For larger graphs, compare an approximate/quantized result against a tiny exact subset or the bundled smoke script before scaling up.

Files in this skill

  • SKILL.md5.1 KB
  • references/api-reference.md16.8 KB
  • references/troubleshooting.md10.1 KB
  • references/workflows.md11.2 KB
  • scripts/gromov_smoke.py9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.