SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.07432 · 2021

Hierarchical graph neural nets can capture long-range interactions

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2107.07432.json · badge: /api/ran/2107.07432.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
rampasek/HGNet canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
evaluate_transductive Ran
ran on a synthesized input
rampasek/HGNet/models/ops.py
code served (permissive licence) · get_code("cb01bfc2fdd9db35")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.tensorboard import SummaryWriter
import numpy as np

torch.manual_seed(0)

# Define a minimal task object
class MinimalTask:
    def __init__(self, is_classification=True, is_multi_task=False, evaluator=None):
        self.is_classification = is_classification
        self.is_multi_task = is_multi_task
        self.evaluator = evaluator

# Define a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.task = MinimalTask(is_classification=True, is_multi_task=False)
    
    def forward(self, data):
        return self.linear(data.x)
    
    def eval(self):
        super().eval()
        return self

# Define a minimal data object with graph-like structure
class MinimalData:
    def __init__(self):
        self.x = torch.randn(8, 4)  # 8 samples, 4 features
        self.y = torch.randint(0, 3, (8,))  # 3 classes
        self.train_mask = torch.tensor([True, True, False, False, False, False, False, False])
        self.val_mask = torch.tensor([False, False, True, True, False, False, False, False])
        self.test_mask = torch.tensor([False, False, False, False, True, True, True, True])
        self.stopping_mask = torch.tensor([False, False, False, False, False, False, True, True])
    
    def to(self, device):
        self.x = self.x.to(device)
        self.y = self.y.to(device)
        return self

# Define options object
class Options:
    def __init__(self):
        self.device = 'cpu'
        self.task = MinimalTask(is_classification=True, is_multi_task=False)
        self.loss_func = nn.CrossEntropyLoss()

# Create instances
model = MinimalModel()
data = MinimalData()
step = 1
tb_writer = None
opts = Options()

ARGS = {
    'model': model,
    'data': data,
    'step': step,
    'tb_writer': tb_writer,
    'opts': opts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_activation Ran
ran on a synthesized input
rampasek/HGNet/models/models.py
code served (permissive licence) · get_code("1f57717f294b2b86")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

def parse_activation(activation_name):
    return {'ELU': F.elu, 'LeakyReLU': F.leaky_relu, 'ReLU': F.relu, 'Tanh': F.tanh}.get(activation_name, None)

ARGS = {
    'activation_name': 'ReLU'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_list Ran
ran on a synthesized input
rampasek/HGNet/models/models.py
code served (permissive licence) · get_code("d4a0e9456a4b29e0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

ARGS = {
    "string": "1,2,3,4,5",
    "dtype": int,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
sanitize_transductive_task Ran
ran on a synthesized input
rampasek/HGNet/dataset.py
code served (permissive licence) · get_code("d5d1528c39d13701")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MockData. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

class MockData:
    def __init__(self):
        num_nodes = 10
        num_classes = 3
        
        # Create a simple graph with edges
        self.edge_index = torch.tensor([
            [0, 1, 1, 2, 2, 3, 3, 4, 4, 5],
            [1, 0, 2, 1, 3, 2, 4, 3, 5, 4]
        ], dtype=torch.long)
        
        # Node features
        self.x = torch.randn(num_nodes, 4)
        
        # Node labels
        self.y = torch.tensor([0, 0, 1, 1, 2, 2, 0, 1, 2, 0], dtype=torch.long)
        
        # Split masks
        self.train_mask = torch.tensor([True, True, False, False, False, False, False, False, False, False], dtype=torch.bool)
        self.val_mask = torch.tensor([False, False, True, True, False, False, False, False, False, False], dtype=torch.bool)
        self.test_mask = torch.tensor([False, False, False, False, True, True, True, True, False, False], dtype=torch.bool)
        self.stopping_mask = torch.tensor([False, False, False, False, False, False, False, False, True, True], dtype=torch.bool)
        
        self.num_nodes = num_nodes

data = MockData()

ARGS = {
    'data': data,
    'k': 1,
    'resample': True,
    'num_train_per_class': 2,
    'num_val': 2,
    'num_test': 2,
    'seed': 321
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockData — a MockData output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockData output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
train_batch Ran
ran on a synthesized input
rampasek/HGNet/models/ops.py
code served (permissive licence) · get_code("2660b29da33c9d4c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import numpy as np
from torch.utils.tensorboard import SummaryWriter
import tempfile
import os

torch.manual_seed(0)

# Create minimal task object
class MinimalTask:
    def __init__(self):
        self.is_classification = True
        self.is_multi_task = False
        self.evaluator = None

# Create minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.task = MinimalTask()
    
    def forward(self, data):
        return self.linear(data.x)

# Create minimal data object
class MinimalData:
    def __init__(self):
        self.x = torch.randn(2, 4)
        self.y = torch.tensor([0, 1])
    
    def to(self, device):
        self.x = self.x.to(device)
        self.y = self.y.to(device)
        return self

# Create minimal options object
class MinimalOpts:
    def __init__(self):
        self.device = 'cpu'
        self.loss_func = nn.CrossEntropyLoss()
        self.log_step = 0
        self.task = MinimalTask()

# Create minimal tensorboard writer
temp_dir = tempfile.mkdtemp()
tb_writer = SummaryWriter(temp_dir)

# Setup arguments
model = MinimalModel()
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
epoch = 0
batch_ind = 0
step = 0
data = MinimalData()
opts = MinimalOpts()

ARGS = {
    'model': model,
    'optimizer': optimizer,
    'epoch': epoch,
    'batch_ind': batch_ind,
    'step': step,
    'data': data,
    'tb_writer': tb_writer,
    'opts': opts
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluate Not yet run
unverified (harvested, no recorded run)
rampasek/HGNet/models/ops.py
code served (permissive licence) · get_code("cb6a59d39c3291cc")
How it ran

no invocation recorded.

read_dataset_outdir Not yet run
unverified (harvested, no recorded run)
rampasek/HGNet/collect_results.py
code served (permissive licence) · get_code("cfcfccedeabb5dde")
How it ran

no invocation recorded.

split_dataset Not yet run
unverified (harvested, no recorded run)
rampasek/HGNet/dataset.py
code served (permissive licence) · get_code("624a91da04cd5dce")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Graph neural networks (GNNs) based on message passing between neighboring nodes are known to be insufficient for capturing long-range interactions in graphs. In this project we study hierarchical message passing models that leverage a multi-resolution representation of a given graph. This facilitates learning of features that span large receptive fields without loss of local information, an aspect not studied in preceding work on hierarchical GNNs. We introduce Hierarchical Graph Net (HGNet), which for any two connected nodes guarantees existence of message-passing paths of at most logarithmic length w.r.t. the input graph size. Yet, under mild assumptions, its internal hierarchy maintains asymptotic size equivalent to that of the input graph. We observe that our HGNet outperforms conventional stacking of GCN layers particularly in molecular property prediction benchmarks. Finally, we propose two benchmarking tasks designed to elucidate capability of GNNs to leverage long-range interactions in graphs.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2107.07432")
get_code_for_paper("2107.07432")
have("2107.07432")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2107.07432.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2107.07432.svg)](https://syntology.ai/paper/2107.07432)

Connect an agent — have() is free.