Skip to content

Track: Track2; Team name: Fernando Espinosa; Model: SheafTSP - #410

Open
ferdavid1 wants to merge 29 commits into
geometric-intelligence:mainfrom
ferdavid1:sheaf-tsp-upstream
Open

Track: Track2; Team name: Fernando Espinosa; Model: SheafTSP#410
ferdavid1 wants to merge 29 commits into
geometric-intelligence:mainfrom
ferdavid1:sheaf-tsp-upstream

Conversation

@ferdavid1

Copy link
Copy Markdown

SheafTSP is a spectral convolutional network whose diffusion operator is
a learned, weighted sheaf Laplacian. The model builds a Hansen–Ghrist
graph sheaf [6] over the 1-cell adjacency structure of the lifted cell
complex and diffuses the signal with a polynomial filter on that
operator, following the Hilbert-bundle framework of Tandon et al. [1].

Each layer:

  1. learns SO(d) restriction maps from an antisymmetrized skew generator
    through the Cayley transform, so R_vu = R_uv^{-1} holds by
    construction and the maps are orientation-equivariant (an exponential
    map projection is available as an option);
  2. weights each edge with a Gaussian kernel on the transport-consistency
    distance ||s_i − R_e s_j|| (Eq. 8 of [1]);
  3. assembles the degree-normalized sheaf Laplacian
    L̂ = D^{-1/2} δᵀKδ D^{-1/2}, whose spectrum lies in [0, 2];
  4. applies a PPR-initialized scalar polynomial filter on the sheaf lazy
    walk P = I − L̂/2 with K = 10 hops (Eq. 10 of [1]);
  5. adds a bounded kernel-alignment regularizer on the transports
    (Eq. 15 of [1], λ = 0.01, signal and bandwidth detached).

Alongside the diffusion machinery, the node embedding carries an
unnormalized count term t_v = |B1||B2|·1, derived from the incidence
matrices of the lifted complex and exact under the all-3-cliques
lifting (Σ t_v = 6 × #triangles). The embedding is assembled with no
post-hoc normalization, because LayerNorm on the sum erases the count
magnitudes. The two challenge tasks want opposite treatments of
normalization, and the architecture keeps an operator-normalized
diffusion signal and a strictly linear count term side by side in one
embedding, protected from each other.

At stalk dimension d = 2 the transports are SO(2) rotations, so the
learned operator specializes to a magnetic Laplacian [5] whose per-edge
phases are learned from data. Measured on trained checkpoints, the
first layer selects mild rotations under homophily (mean |θ| = 9.9°)
and near-antipodal maps under heterophily (mean |θ| = 165.8°), flipping
anti-correlated neighbors into consistency.

Results

Official 72-run grid (12 GraphUniverse settings × 3 seeds × 2 tasks),
run with the unmodified evaluation protocol:

Task Score
Community detection (accuracy, higher is better) 0.4735
Triangle counting (MSE / triangle, lower is better) 0.0108

Per-run values: 2026_tdl_challenge/outputs/sheaf_tsp_full_grid/results.json.
run_evaluation.ipynb is changed on the single permitted line
(MODEL_CONFIG = "cell/sheaf_tsp").

Files

topobench/nn/backbones/cell/sheaf_tsp.py                      backbone
topobench/nn/wrappers/cell/sheaf_tsp_wrapper.py               wrapper
configs/model/cell/sheaf_tsp.yaml                             model config
configs/transforms/model_defaults/sheaf_tsp.yaml              lifting defaults
topobench/transforms/liftings/graph2cell/clique_cell_lifting.py  all-3-cliques lifting
configs/transforms/liftings/graph2cell/clique_cell.yaml       lifting config
topobench/transforms/data_manipulations/triangle_degree.py    verification transform
test/nn/backbones/cell/test_sheaf_tsp.py                      backbone tests
test/nn/wrappers/cell/test_sheaf_tsp_wrapper.py               wrapper tests
test/transforms/liftings/graph2cell/test_clique_cell_lifting.py  lifting tests
test/transforms/data_manipulations/test_TriangleDegree.py     transform tests
docs/sheaf_tsp/                                               reviewer docs

Documentation for reviewers is under docs/sheaf_tsp/: an overview of
the approach (hypotheses, each equation, design principles, grid
results), architecture flow diagrams, and an executable notebook that
verifies the claimed properties (orthogonality, orientation
equivariance, exact counting) on a toy graph.

The CellCliqueLifting transform adds every 3-clique as a 2-cell; the
result is canonical and permutation-invariant, which the cycle-basis
lifting is not (a cycle basis depends on node order and undercounts
triangles in dense neighborhoods).

Backbone and wrapper are auto-discovered through
ModelExportsManager/WrapperExportsManager; no __init__.py edits.

Tests

  • 29 tests across four suites: backbone (orthogonality, orientation
    equivariance, spectrum bounds, dense/sparse agreement, the shipped
    configuration, sparse autoselect), wrapper (count injection,
    regularizer gating), lifting (K4 completeness, permutation
    invariance), and TriangleDegree
  • per-file coverage: backbone 99%, wrapper 100%, lifting 100%,
    TriangleDegree 100%
  • ruff check and ruff format clean
  • includes a small idempotency fix for the hypergraph dataset
    download() (junk directories inside some hosted archives made
    re-downloads fail), which was surfacing as an order-dependent
    loader-test failure

Checklist

  • The PR has a clear, explanatory title
  • The code passes linting (ruff check and ruff format --check clean)
  • Unit tests are added and passing (29 SheafTSP tests; full suite
    1004 passed, 0 failed)
  • The code is PEP8 compliant
  • Documentation follows numpydoc conventions with parameter and
    return annotations
  • results.json from the unmodified official evaluation protocol
    is included, with heatmap and OOD visualizations

References

  1. Tandon, Gould, Bhatia, Dominici, Ribeiro & Battiloro, "Consistent
    Geometric Deep Learning via Hilbert Bundles and Cellular Sheaves"
    (2026), arXiv:2605.06395
  2. Bodnar, Di Giovanni, Chamberlain, Liò & Bronstein, "Neural Sheaf
    Diffusion" (NeurIPS 2022), arXiv:2202.04579
  3. Bamberger, Barbero, Dong & Bronstein, "Bundle Neural Networks for
    message diffusion on graphs" (2024), arXiv:2405.15540
  4. Chen, Chen, Villar & Bruna, "Can Graph Neural Networks Count
    Substructures?" (NeurIPS 2020), arXiv:2002.04025
  5. Zhang, He, Brugnone, Perlmutter & Hirn, "MagNet: A Neural Network
    for Directed Graphs" (NeurIPS 2021), arXiv:2102.11391
  6. Hansen & Ghrist, "Toward a spectral theory of cellular sheaves",
    J. Appl. Comput. Topol. 3(4):315–358, 2019

Fernando Espinosa and others added 26 commits July 20, 2026 13:10
- 4 submission files (backbone, wrapper, config, tests)
- opt-in persistence node features transform
- all 11 unit tests pass on upstream

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- wrapper: rank-2 degree signal t_v = |B_1||B_2|1 through zero-init
  linear embed (warm-started channel 0), replaces base-class LayerNorm
  residual (residual_connections: false)
- backbone: mlp_dropout knob — dropout on restriction-map learner input
  only; signal-path dropout corrupts the count pathway
- model_defaults transform: cycle lifting with max_cell_length=3
  (triangle-only 2-cells)
- 3-seed validation (h_lo/h_mid): CD 0.3077/0.4033, TRI 0.0063/0.0748

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Screened on the official protocol: CD gains within seed noise, TRI
costs real (+27%/+54%) — rejected for the shared submission config,
kept as documented research options.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
reg_form: dirichlet (default) | alignment. Bounded per-edge reward
-mean(exp(-||s_i - R_e s_j||^2/4t)), detached signal; targets the
dense-cell TRI gap.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mid TRI 0.0792 / dense TRI 0.2462 (-27% vs 0.338) / mid CD 0.4038 /
hard CD 0.3057 - all within or better than candidate seed ranges.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Both zero/identity at init, default off. stream_gate lets a task
learn to suppress feature streams around the exact count channel;
global_context adds a per-layer whole-complex summary (EHNN pattern).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Root cause of the TRI ceiling: CellCycleLifting attaches a cycle
BASIS (nx.cycle_basis), undercounting triangles on dense graphs
(measured 59 basis cells vs 139 true triangles at n=40, p=0.25).
The wrapper's count channel inherited that bias, which explains the
dense-cell weakness, the warm-init insensitivity, and training
shrinking the count channel. TriangleDegree attaches exact per-node
counts at preprocessing; wrapper prefers them over |B1||B2|1.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
SheafConvLayer with learned O(d) transports and kernel weighting on
the exact triangle co-membership graph (A .* A^2 pattern, computed
from incidence_1, independent of the cycle-basis lifting). Zero-init
fusion into x_0. Substrate credit: HiGCN's order-2 Flower-Petals
observation; the diffusion mechanism is SheafTSP's own.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
3-seed CD 0.4151±0.006 (= full-stack's 0.4162 within noise), TRI
0.000393 (154x under the field's best). Dropout-free: no PPR-rescue
dependency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- RestrictionMapLearner: antisymmetrized skew generator, so
  R_vu = R_uv^{-1} by construction and the model is invariant to node
  relabeling (property-tested: equivariance 1e-7, relabeling 0.0).
- Alignment regularizer: t detached; the reward otherwise saturates
  as t grows independent of the transports (measured leak 8.7e-4,
  now 0.0).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…stic

Transport-angle diagnostic on the mid-cell CD checkpoint: layer-0
mean |theta| 9.9 deg, 68% of edges above 5 deg — learned transports
are non-trivial; the sheaf has not collapsed to a weighted GCN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CellCliqueLifting replaces the cycle-basis lifting in sheaf_tsp
model defaults. Verified: complete (14/14 true triangles) and
invariant under node relabeling (identical 2-cell sets); the
cycle-basis lifting produces 11 vs 10 cells with 8 shared on the
same relabeled graph. Closes the external review's Flaw II and the
operator-side cycle-basis bias documented in P5.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- rotation_param: cayley | exp. The exponential map is surjective
  onto SO(d): antipodal transports are reachable with bounded
  generators (verified: exp(pi J) = -I exactly), removing the Cayley
  obstruction on heterophilic cells.
- count_source: auto | incidence. Under the clique lifting,
  |B_1||B_2|1 is exact (verified 139/139), so the count signal can be
  derived from the lifted complex's own incidence structure.
- Spectral bound numerically verified with kernel-weighted degrees
  (max eig 1.83 <= 2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
count_source: incidence — t_v = |B_1||B_2|1 from the lifted complex,
exact under the clique lifting (verified 139/139), measured mid-cell
TRI 0.00457 (13x under the field's best). The counting signal now has
the same provenance as the incidence structure every lifted model
consumes. TriangleDegree remains available as a standalone transform.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Recovered from the pre-sync backup branch and rewritten: clique
lifting, transport-consistency kernel, PPR diffusion default,
antisymmetrized SO(d) transports, endogenous counting pathway. Two new
executable property demos (orientation equivariance to 2.4e-7; exact
counting verified against enumeration). All walkthrough cells execute.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… maps

BuNN (arXiv:2405.15540) is by Bamberger, Barbero, Dong & Bronstein and
parameterizes orthogonal maps via Householder reflections (direct SO(2)
at d=2); it is precedent for learned orthogonal bundle maps on graphs,
with the Cayley projection here following the orthogonal-RNN lineage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed config comments

results.json from the official protocol (12 settings x 3 seeds x 2
tasks): community detection 0.4735, triangle-count MSE/triangle 0.0108.
run_evaluation.ipynb changed on the single permitted line only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New: wrapper suite (count injection, tri_degree source, dirichlet
gating, stream gate, petals, petal-edge extraction), clique lifting
suite (K4 completeness, triangle-free, permutation invariance),
TriangleDegree suite, and backbone additions (exp map, d=1 stalks,
shipped ppr/transport/alignment configuration, constructor
validation, sparse autoselect, global context).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Files were added by our integration commit, are absent from upstream,
and nothing references them.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Same artifact set the other Track 2 submissions ship alongside
results.json.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Some hosted archives contain junk directories (.ipynb_checkpoints in
the Mushroom zip). The per-file shutil.move in download() nests such
a directory into its existing counterpart on any re-download and
raises, which made test_dataset_loading_states order-dependent.
Overwrite existing destinations before moving.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The explainer notebook joins the approach overview, the architecture
diagrams, and a README summarizing the submission. The one-time
notebook generator script is removed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Fernando Espinosa and others added 2 commits July 31, 2026 02:27
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…lines

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gbg141 gbg141 added the track-2-tnn 2026 Topological Deep Learning Challenge -- Track 2 TNNs label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

track-2-tnn 2026 Topological Deep Learning Challenge -- Track 2 TNNs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants