Track: Track1; Team name: Sheafu; Model: Neural Sheaf Propagation (NSP) + Holonomy Measurement (analysis notebook)#373
Open
Agrover112 wants to merge 11 commits into
Open
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Supplementary analysis for the NSP submission (Team Sheafu), in 2026_tdl_challenge/holonomy_audit/: the executable Holonomy Audit notebook (reads committed *_results.json; no training or GPU), its generator, the experiment harness, result JSONs, and a README. The gauge-invariant holonomy instrument lives with the library it audits (nsd_utils/sheaf_holonomy.py, holonomy_capture.py) with 26 unit tests. The required NSP evaluation artifacts (run_evaluation.ipynb, results.json) are untouched. Companion paper: Measuring Triangle Holonomy in Sheaf Neural Networks (arXiv link to follow).
A short, non-technical summary near the top: what we measured, that the geometry is recruited task-specifically, and that it never becomes a working cycle counter. Restates existing findings in plain terms; no new claims, numbers, or code changes. Re-executed: 31 cells, 0 errors, 8 figures.
Cut grandiose/paper-style connective prose and simplified the gauge- invariance, polar-decomposition, and flattening explanations without changing any formal claim or MathJax. Result sections now read question -> experiment -> result -> verdict; the H1 opening no longer glosses NSD's bimodal control arm. Removed the Statistical summary markdown cell and its Table 1 code cell (its numbers already appear with each experiment; nothing downstream referenced it). Every other code cell is byte-identical. Re-executed: 29 cells, 0 errors, 8 figures; all statistics preserved.
Dropped the hand-drawn holonomy schematic (its own code cell) and reworded the §3 instrument prose to describe the audit directly. Renumbered the seven data figures and every reference (prose and plot titles) from 2-8 to 1-7. No statistics or data-cell logic changed. Re-executed: 28 cells, 0 errors, 7 figures.
§4 now states each hypothesis and the figure that tests it; the results and verdicts are no longer duplicated there (they remain in §6). Moved the 'H1 across the two dynamics' robustness note into Part II §9 (next to the NSD discussion) and renumbered §6.5-6.7 to 6.4-6.6 with matching cross-refs. No statistic changed. Re-executed: 27 cells, 0 errors, 7 figures.
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.
Checklist
Description
This PR implements Neural Sheaf Propagation (NSP), introduced in Surfing on the Neural Sheaf, as a Track 1 (GNN) submission for the TDL Challenge 2026 (
model=graph/nsp).From sheaf diffusion to sheaf propagation
Neural Sheaf Diffusion (NSD) is motivated by the first-order sheaf heat equation:
Heat diffusion progressively damps non-harmonic components of the signal. This is useful for smoothing, but repeated diffusion can also make node representations increasingly similar.
NSP replaces this first-order dynamics with a second-order sheaf wave equation:
In the ideal linear system, the spectral modes oscillate rather than being monotonically damped. NSP uses this wave-like behaviour to propagate information while retaining non-smooth components that ordinary diffusion may suppress.
The learnable spatial term combines the sheaf Laplacian with left and right feature transformations:
This implementation integrates the resulting second-order dynamics with a leapfrog update:
where:
step_size;The implementation initializes
x_prevandx_currto the same encoded feature tensor. This corresponds to zero initial discrete velocity.Provenance. The architecture follows the propagation scheme introduced in the paper and reuses TopoBench's existing Neural Sheaf Diffusion infrastructure. This is an independent implementation; see Related.
Configuration
configs/model/graph/nsp.yamlexposes one NSP architecture with the following options:d3step_size0.5sheaf_typediagsecond_linearfalselin_second, before propagation begins.new_laplacian_each_steptruefalseto reuse one fixed operator.Restriction-map families
sheaf_typediagd >= 1bundleO(d)d > 1generald × dmapsd > 1The diagonal configuration is used for the reported challenge results.
What is contributed
topobench/nn/backbones/graph/nsp.pyNSPEncoderand adapts sheaf wave propagation to TopoBench'sforward(x, edge_index) -> [N, hidden_dim]interface.topobench/nn/backbones/graph/nsd_utils/inductive_discrete_models.pyconfigs/model/graph/nsp.yamlTBModelcomposition used by both challenge tasks.test/nn/backbones/graph/test_nsp.pytest/pipeline/test_pipeline.pygraph/nspongraph/MUTAG.Reused TopoBench components
No changes were required to the following components:
AllCellFeatureEncoderencodes the input features;GNNWrapperintegrates the backbone into the model pipeline;MLPReadoutconverts the node embeddings produced by the backbone into task predictions.Implementation and faithfulness notes
Leapfrog step size
The paper lists a step-size hyperparameter, but its displayed propagation equation does not explicitly place an (h^2) factor on the nonlinear force term. This implementation follows the standard central-difference discretization:
Substituting the wave equation gives the implemented recurrence with
step_size**2:The (h^2) coefficient is therefore an explicit numerical-discretization choice in this implementation rather than a claim that the paper writes the coefficient in exactly this form.
Dynamic and fixed sheaf geometry
The submitted configuration uses dynamic geometry by default:
With this setting, the restriction maps and sheaf operator are recomputed from the current features at every propagation step. Setting the flag to
falsebuilds the operator once from the initially encoded features and reuses it throughout the network. In fixed mode, only one sheaf learner is retained, which avoids unused parameters.No diffusion residual coefficient
The NSP classes remove NSD's learnable per-layer diffusion coefficients, commonly represented by (\varepsilon). Those coefficients belong to the first-order residual diffusion update and are not used by the second-order leapfrog recurrence.
Positional features
The paper also studies Laplacian eigenvectors as optional positional features. They are not computed inside
NSPEncoderbecause TopoBench already providesLapPE, which can be applied as a separate input transform.Framework adaptations
MLPReadoutproduces the final task outputs.to_undirected, matching the existing TopoBench graph-backbone convention.Testing
test/nn/backbones/graph/test_nsp.pycovers:d=1for the diagonal model;step_sizeon the magnitude of a deep propagation response;lin_secondwhensecond_linear=true;epsilonsparameters;graph/nspis also included intest/pipeline/test_pipeline.pyfor end-to-end training ongraph/MUTAG. The new files pass the configuredruffandnumpydocchecks.Evaluation
2026_tdl_challenge/run_evaluation.ipynbwas run with the default diagonal restriction maps. The resulting file contains 72 runs across seeds 42, 43, and 44:2026_tdl_challenge/outputs/nsp/results.jsonThe in-distribution means over the 12 GraphUniverse settings are:
The full per-setting, per-seed, and out-of-distribution results are stored in
results.json. Thebundleandgeneralvariants are implemented and unit-tested but were not included in this benchmark run.results.jsonprovenanceOn
main, the notebook's committedexpected_hash(f87b2c…) does not match the hash computed from its committed cells (3c1d78…). As a result, the notebook's integrity check raises aValueErrorbefore evaluation begins.For the reported run,
expected_hashwas updated locally to the hash of the existing notebook cells. The evaluation grid andutils.pywere not changed. A separate maintainer issue can be used to refresh the stale committed hash.Reproducing the results
Issue
As per the research questions of track-1, NSP was contributed to test whether second-order wave-based sheaf propagation can preserve structural and high-frequency information better than the first-order smoothing dynamics used by Neural Sheaf Diffusion.
Related
This PR is an independent NSP implementation built on TopoBench's NSD utilities. Its defining implementation choices are the explicit (h^2) leapfrog scaling, support for dynamic and fixed sheaf geometry, and diagonal, orthogonal-bundle, and general restriction-map variants.
Supplementary analysis: Holonomy Measurement (Team Sheafu)
Exploratory analysis notebook, under
2026_tdl_challenge/holonomy_audit/. The required NSP evaluation artifacts (run_evaluation.ipynb,results.json) are unchanged; the analysis adds no dependency to the NSP model. Its folderREADME.mdfollows.Do sheaf networks use their geometry?
This directory contains supplementary analysis for Team Sheafu's Neural Sheaf Propagation (NSP) submission to the Topological Deep Learning Challenge 2026, Track 1. The analysis opens trained sheaf neural networks and looks at the geometry they learn around triangles.
Question and findings
The analysis asks two things: does a trained sheaf network actually develop cycle geometry, and do its predictions come to depend on it?
In these experiments the pattern is consistent. Training a model to count triangles makes its SO(2) maps rotate features around each triangle about 40x more than at initialisation; training the same architecture to detect communities leaves those maps nearly flat. The geometry is recruited, and only for the task that should need it. With enough data the model also starts to rely on it: flatten the learned connection afterwards and the error grows sharply.
What the geometry never does is count. A plain ridge regression on a handful of degree statistics still beats every sheaf model, so the networks do not even match that simple shortcut. And once we remove the shortcut, using regular graphs where every node has the same degree so that reading the wiring is the only way to tell graphs apart, no model does better than predicting the average, at any data scale and however large the twist grows. The geometry gets recruited and becomes load-bearing, but it never turns into a working cycle counter.
The companion paper is Measuring Triangle Holonomy in Sheaf Neural Networks (arXiv:2607.19514).
Files
holonomy_audit.ipynbbuild_holonomy_notebook.pyholonomy_audit.ipynb. The notebook's text and code live here as a plain Python script.holonomy_experiment.pyholonomy_lobotomy.pyholonomy_regular.pydegree_baselines.pyverify_diagnostic.pyscaling_experiment.pyscaling_baselines.pybigtest_eval.py*_results.json(11 files)The measurement tool itself lives with the library it audits, outside this directory:
topobench/nn/backbones/graph/nsd_utils/sheaf_holonomy.pyandholonomy_capture.py, with 26 unit tests undertest/nn/backbones/graph/.Reproducing the notebook
From this directory, with the TopoBench Python 3.11 environment active, run:
The notebook does no training and needs no GPU. Drawing the figures and computing the statistics needs
numpy,pandas,scipy, andmatplotlib. A few cells re-run the small checks that confirm the holonomy measurement tool is behaving correctly; those importtorchandtorch_geometricand run fine on CPU. Regenerating the JSON files from scratch is optional and is not needed to read or re-render the notebook.