SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.12265 · 2019

Strategies for Pre-training Graph Neural Networks

Weihua Hu, Jure Leskovec, Percy Liang, Marinka Zitnik, Joseph Gomes, Vijay Pande, Bowen Liu

arXiv · PDF · Open in the Atlas

Code that ran

13 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 4 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 5 failures of our instrument; 1 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/1905.12265.json · badge: /api/ran/1905.12265.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
snap-stanford/pretrain-gnns canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
leffff/any-domain-pretrain-gnns community
Papers with Code archive
4 ran · 0 no recorded run
jacquesboitreaud/DeepFRED community
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
ExtractSubstructureContextPair Ran
ran on a synthesized input · constructed an object; no result was computed
leffff/any-domain-pretrain-gnns/modules/util.py
code served (permissive licence) · get_code("bbcb70f28827b5eb")
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 an instance of its own class, ExtractSubstructureContextPair: the run constructed the object and did not call it, so no result was computed. 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
import networkx as nx
import numpy as np
from torch_geometric.data import Data

torch.manual_seed(0)

# Construct a simple PyTorch Geometric Data object with node and edge features
# This represents a small molecule graph

# Create node features: 4 atoms with 2 features each (atom_num_idx, chirality_tag_idx)
x = torch.tensor([
    [6, 0],      # atom 0: carbon, no chirality
    [7, 1],      # atom 1: nitrogen, chirality 1
    [8, 0],      # atom 2: oxygen, no chirality
    [1, 0]       # atom 3: hydrogen, no chirality
], dtype=torch.long)

# Create edges: connect atoms in a chain-like structure
# edge_index format: [source_nodes, target_nodes]
edge_index = torch.tensor([
    [0, 1, 1, 2, 2, 0],  # source nodes
    [1, 0, 2, 1, 0, 2]   # target nodes (undirected graph, so bidirectional)
], dtype=torch.long)

# Create edge features: 6 edges with 2 features each (bond_type_idx, bond_dir_idx)
edge_attr = torch.tensor([
    [1, 0],      # edge 0-1
    [1, 0],      # edge 1-0 (reverse)
    [2, 1],      # edge 1-2
    [2, 1],      # edge 2-1 (reverse)
    [1, 0],      # edge 2-0
    [1, 0]       # edge 0-2 (reverse)
], dtype=torch.long)

# Construct the Data object
data_obj = Data(x=x, edge_index=edge_index, edge_attr=edge_attr)

# Define arguments for ExtractSubstructureContextPair
ARGS = {
    'k': 1,      # 1-hop neighbors for substructure
    'l1': 2,     # l1 parameter for context
    'l2': 3      # l2 parameter for context
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ExtractSubstructureContextPair — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ExtractSubstructureContextPair 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
compute_accuracy Ran
ran, honoured the contract we drafted
snap-stanford/pretrain-gnns/bio/pretrain_masking.py
pointer only (licence: MIT); the stored copy get_code serves, from junxia97/mole-bert, is pointer only (licence: NONE) · get_code("1d31c46fec1fe3d1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from junxia97/mole-bert, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

cycle_index Ran
ran, honoured the contract we drafted
snap-stanford/pretrain-gnns/bio/pretrain_contextpred.py
pointer only (licence: MIT); the stored copy get_code serves, from shen-lab/graphcl_automated, is pointer only (licence: NONE) · get_code("b822dd00427403bf")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from shen-lab/graphcl_automated, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

draw_rec Ran
ran; our contract draft was wrong, not the code
jacquesboitreaud/DeepFRED/model.py
pointer only (licence: NONE) · get_code("222d4809f4d05157")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jacquesboitreaud/DeepFRED when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

eval Ran
ran, honoured the contract we drafted
snap-stanford/pretrain-gnns/bio/finetune.py
pointer only (licence: MIT); the stored copy get_code serves, from byronji/drgcl, is pointer only (licence: NONE) · get_code("17ef9103436a92bf")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from byronji/drgcl, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

graph_data_obj_to_nx_simple Ran
ran, honoured the contract we drafted
leffff/any-domain-pretrain-gnns/modules/util.py
code served (permissive licence) · get_code("287484b87212f47d")
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 Graph. 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
from torch_geometric.data import Data

torch.manual_seed(0)

# Create a small graph Data object with 3 atoms and 2 bonds
# Atom features: [atomic_num_idx, chirality_tag_idx]
atom_features = torch.tensor([
    [6, 0],      # atom 0: carbon, no chirality
    [7, 1],      # atom 1: nitrogen, chirality 1
    [8, 0]       # atom 2: oxygen, no chirality
], dtype=torch.float32)

# Edge index: [2, 4] tensor representing edges
# Each pair of rows represents one undirected edge (stored twice in PyG convention)
edge_index = torch.tensor([
    [0, 1, 1, 0],    # source atoms
    [1, 0, 2, 2]     # target atoms
], dtype=torch.long)

# Edge attributes: [bond_type_idx, bond_dir_idx]
edge_attr = torch.tensor([
    [1, 0],          # bond 0-1: single bond, no direction
    [1, 0],          # bond 1-0: single bond, no direction
    [2, 1],          # bond 1-2: double bond, direction 1
    [2, 1]           # bond 2-1: double bond, direction 1
], dtype=torch.float32)

# Create PyG Data object
data_obj = Data(x=atom_features, edge_index=edge_index, edge_attr=edge_attr)

ARGS = {
    "data": data_obj
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Graph — a Graph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Graph output the recorded ndim 1 and dtype family int 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
nx_to_graph_data_obj_simple Ran
ran; our contract draft was wrong, not the code
leffff/any-domain-pretrain-gnns/modules/util.py
code served (permissive licence) · get_code("1aa34efbfaf5d9ec")
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 Data. 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
import networkx as nx

torch.manual_seed(0)

# Create a simple networkx graph with the required node and edge attributes
G = nx.Graph()

# Add nodes with required attributes
G.add_node(0, atom_num_idx=1, chirality_tag_idx=0)
G.add_node(1, atom_num_idx=2, chirality_tag_idx=1)
G.add_node(2, atom_num_idx=3, chirality_tag_idx=0)

# Add edges with required attributes
G.add_edge(0, 1, bond_type_idx=1, bond_dir_idx=0)
G.add_edge(1, 2, bond_type_idx=2, bond_dir_idx=1)

ARGS = {
    'G': G
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, numpy, torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Data — a Data output has no array shape of its own; none is 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
pool_func Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
snap-stanford/pretrain-gnns/bio/pretrain_contextpred.py
code served (permissive licence) · get_code("7164f5ee51907055")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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
from torch_geometric.nn import global_add_pool, global_mean_pool, global_max_pool

torch.manual_seed(0)

# Create node features tensor: shape (num_nodes, num_features)
# Using 6 nodes with 4 features each
x = torch.randn(6, 4)

# Create batch tensor: indicates which graph each node belongs to
# Two graphs: nodes 0-2 belong to graph 0, nodes 3-5 belong to graph 1
batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

# Mode parameter for pooling operation
mode = 'sum'

ARGS = {
    'x': x,
    'batch': batch,
    'mode': mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
pretrainLoss Ran
ran; our contract draft was wrong, not the code
jacquesboitreaud/DeepFRED/model.py
pointer only (licence: NONE) · get_code("3ea05514e649e301")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jacquesboitreaud/DeepFRED when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

reset_idxes Ran
ran; our contract draft was wrong, not the code
leffff/any-domain-pretrain-gnns/modules/util.py
code served (permissive licence) · get_code("6203c137185fa051")
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 tuple. 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 networkx as nx

# Create a small graph with non-sequential node indices
G = nx.Graph()
G.add_edges_from([(5, 10), (10, 15), (15, 5)])
G.add_node(20)

ARGS = {
    "G": G
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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 Ran
ran on a synthesized input
snap-stanford/pretrain-gnns/bio/pretrain_contextpred.py
code served (permissive licence) · get_code("4a6a649883d9c960")
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 tuple, ndim 1, dtype family float; 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 torch.nn as nn
from torch_geometric.data import Data, DataLoader
from torch.optim import Adam

torch.manual_seed(0)

class SimpleGNN(nn.Module):
    def __init__(self, in_channels, hidden_channels, out_channels):
        super(SimpleGNN, self).__init__()
        self.lin1 = nn.Linear(in_channels, hidden_channels)
        self.lin2 = nn.Linear(hidden_channels, out_channels)
    
    def forward(self, x, edge_index, edge_attr):
        x = torch.relu(self.lin1(x))
        x = self.lin2(x)
        return x

class ArgsConfig:
    def __init__(self, mode='cbow', neg_samples=2, context_pooling='sum'):
        self.mode = mode
        self.neg_samples = neg_samples
        self.context_pooling = context_pooling

def create_batch_data():
    num_substruct_nodes = 5
    num_context_nodes = 6
    num_overlapped = 3
    feat_dim = 4
    edge_dim = 2
    
    x_substruct = torch.randn(num_substruct_nodes, feat_dim)
    edge_index_substruct = torch.tensor([
        [0, 1, 2, 3],
        [1, 2, 3, 4]
    ], dtype=torch.long)
    edge_attr_substruct = torch.randn(edge_index_substruct.shape[1], edge_dim)
    center_substruct_idx = torch.tensor([0, 2], dtype=torch.long)
    
    x_context = torch.randn(num_context_nodes, feat_dim)
    edge_index_context = torch.tensor([
        [0, 1, 2, 3, 4],
        [1, 2, 3, 4, 5]
    ], dtype=torch.long)
    edge_attr_context = torch.randn(edge_index_context.shape[1], edge_dim)
    overlap_context_substruct_idx = torch.tensor([0, 1, 2], dtype=torch.long)
    batch_overlapped_context = torch.tensor([0, 0, 1], dtype=torch.long)
    overlapped_context_size = torch.tensor([2, 1], dtype=torch.long)
    
    data = Data(
        x_substruct=x_substruct,
        edge_index_substruct=edge_index_substruct,
        edge_attr_substruct=edge_attr_substruct,
        center_substruct_idx=center_substruct_idx,
        x_context=x_context,
        edge_index_context=edge_index_context,
        edge_attr_context=edge_attr_context,
        overlap_context_substruct_idx=overlap_context_substruct_idx,
        batch_overlapped_context=batch_overlapped_context,
        overlapped_context_size=overlapped_context_size,
    )
    
    return data

# Create models
model_substruct = SimpleGNN(in_channels=4, hidden_channels=8, out_channels=3)
model_context = SimpleGNN(in_channels=4, hidden_channels=8, out_channels=3)

# Create loader with two batches
loader = [create_batch_data(), create_batch_data()]

# Create optimizers
optimizer_substruct = Adam(model_substruct.parameters(), lr=0.01)
optimizer_context = Adam(model_context.parameters(), lr=0.01)

# Create args
args = ArgsConfig(mode='cbow', neg_samples=2, context_pooling='sum')

# Device
device = 'cpu'

ARGS = {
    'args': args,
    'model_substruct': model_substruct,
    'model_context': model_context,
    'loader': loader,
    'optimizer_substruct': optimizer_substruct,
    'optimizer_context': optimizer_context,
    'device': device,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torch_geometric, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
train Ran
ran on a synthesized input
snap-stanford/pretrain-gnns/bio/pretrain_deepgraphinfomax.py
code served (permissive licence) · get_code("72b72fdcfbe3d398")
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 tuple, ndim 1, dtype family float; 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 torch.nn as nn

torch.manual_seed(0)

# Define minimal model components
class SimpleGNN(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 5)
    
    def forward(self, x, edge_index, edge_attr):
        return self.linear(x)

class SimplePool(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5, 3)
    
    def forward(self, node_emb, batch):
        return self.linear(node_emb)

class SimpleDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(5 + 3, 1)
    
    def forward(self, node_emb, summary_emb):
        combined = torch.cat([node_emb, summary_emb], dim=1)
        return self.linear(combined)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.gnn = SimpleGNN()
        self.pool = SimplePool()
        self.discriminator = SimpleDiscriminator()
        self.loss = nn.BCEWithLogitsLoss()

# Create a simple batch class
class SimpleBatch:
    def __init__(self, x, edge_index, edge_attr, batch):
        self.x = x
        self.edge_index = edge_index
        self.edge_attr = edge_attr
        self.batch = batch
    
    def to(self, device):
        self.x = self.x.to(device)
        self.edge_index = self.edge_index.to(device)
        self.edge_attr = self.edge_attr.to(device)
        self.batch = self.batch.to(device)
        return self

# Create sample data batches
batch1_x = torch.randn(6, 4)
batch1_edge_index = torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.long)
batch1_edge_attr = torch.randn(3, 2)
batch1_batch = torch.tensor([0, 0, 0, 1, 1, 1], dtype=torch.long)

batch2_x = torch.randn(4, 4)
batch2_edge_index = torch.tensor([[0, 1], [1, 2]], dtype=torch.long)
batch2_edge_attr = torch.randn(2, 2)
batch2_batch = torch.tensor([0, 0, 1, 1], dtype=torch.long)

batch1 = SimpleBatch(batch1_x, batch1_edge_index, batch1_edge_attr, batch1_batch)
batch2 = SimpleBatch(batch2_x, batch2_edge_index, batch2_edge_attr, batch2_batch)

loader = [batch1, batch2]

model = SimpleModel()
device = torch.device('cpu')
optimizer = torch.optim.Adam(model.parameters(), lr=0.001)

args = {}

ARGS = {
    'args': args,
    'model': model,
    'device': device,
    'loader': loader,
    'optimizer': optimizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
train Ran
ran on a synthesized input
snap-stanford/pretrain-gnns/bio/pretrain_edgepred.py
code served (permissive licence) · get_code("b59818bdda2f75f5")
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 tuple, ndim 1, dtype family float; 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 torch.nn as nn

torch.manual_seed(0)

# Define a minimal model that satisfies the function's usage
class MinimalGNNModel(nn.Module):
    def __init__(self, input_dim, hidden_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, hidden_dim)
    
    def forward(self, x, edge_index, edge_attr):
        # x: node features
        # edge_index: edge connectivity
        # edge_attr: edge attributes
        # Returns node embeddings
        return self.linear(x)

# Create minimal batch object with required attributes
class MinimalBatch:
    def __init__(self):
        # Node features: 6 nodes, 4-dim features
        self.x = torch.randn(6, 4)
        # Edge index: 2 x num_edges (8 edges total, half positive half negative)
        self.edge_index = torch.tensor([[0, 1, 2, 3, 4, 5, 0, 1],
                                        [1, 2, 3, 4, 5, 0, 2, 3]], dtype=torch.long)
        # Edge attributes: num_edges x attr_dim
        self.edge_attr = torch.randn(8, 3)
        # Negative edge index for negative sampling
        self.negative_edge_index = torch.tensor([[0, 1, 2, 3],
                                                 [3, 4, 5, 0]], dtype=torch.long)
    
    def to(self, device):
        self.x = self.x.to(device)
        self.edge_index = self.edge_index.to(device)
        self.edge_attr = self.edge_attr.to(device)
        self.negative_edge_index = self.negative_edge_index.to(device)
        return self

# Create model
model = MinimalGNNModel(input_dim=4, hidden_dim=8)

# Create device
device = torch.device('cpu')

# Create data loader (list of batches)
batch1 = MinimalBatch()
batch2 = MinimalBatch()
loader = [batch1, batch2]

# Create optimizer
optimizer = torch.optim.Adam(model.parameters(), lr=0.01)

# Create args dict
ARGS = {
    'args': None,
    'model': model,
    'device': device,
    'loader': loader,
    'optimizer': optimizer
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
eval Not yet run
unverified (harvested, no recorded run)
snap-stanford/pretrain-gnns/chem/pretrain_supervised.py
code served (permissive licence) · get_code("9e5655ddc71338f6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 6 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 6 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.

FunctionAlso present inEarliest-datedOthers named
graph_data_obj_to_nx_simple
brick of this paper's assembly: helper
9 other papers
9 later
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion
2306.07812 (2023-06)
Automated 3D Pre-Training for Molecular Property Prediction
2309.01788 (2023-09)
Hierarchical Grammar-Induced Geometry for Data-Efficient Molecular Property Prediction
and 6 more not named here
cycle_index 8 other papers
8 later
2010.13902 (2020-10)
Graph Contrastive Learning with Augmentations
2106.07594 (2021-06)
Graph Contrastive Learning Automated
2212.10789 (2022-12)
Multi-modal Molecule Structure-text Model for Text-based Retrieval and Editing
and 5 more not named here
compute_accuracy 3 other papers
3 later
2210.16484 (2022-10)
A Systematic Survey of Chemical Pre-trained Models
2311.04419 (2023-11)
PepLand: a large-scale pre-trained peptide representation model for a comprehensive landscape of both canonical and non-canonical amino acids
2404.15806 (2024-04)
Where to Mask: Structure-Guided Masking for Graph Masked Autoencoders
eval 1 other paper
1 later
2312.10401 (2023-12)
Rethinking Dimensional Rationale in Graph Contrastive Learning from Causal Perspective
pool_func 1 other paper
1 later
2309.01788 (2023-09)
Hierarchical Grammar-Induced Geometry for Data-Efficient Molecular Property Prediction
reset_idxes
brick of this paper's assembly: helper
1 other paper
1 later
2302.04451 (2023-02)
Generalization in Graph Neural Networks: Improved PAC-Bayesian Bounds on Graph Diffusion

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

Many applications of machine learning require a model to make accurate predictions on test examples that are distributionally different from training ones, while task-specific labels are scarce during training. An effective approach to this challenge is to pre-train a model on related tasks where data is abundant, and then fine-tune it on a downstream task of interest. While pre-training has been effective in many language and vision domains, it remains an open question how to effectively use pre-training on graph datasets. In this paper, we develop a new strategy and self-supervised methods for pre-training Graph Neural Networks (GNNs). The key to the success of our strategy is to pre-train an expressive GNN at the level of individual nodes as well as entire graphs so that the GNN can learn useful local and global representations simultaneously. We systematically study pre-training on multiple graph classification datasets. We find that naïve strategies, which pre-train GNNs at the level of either entire graphs or individual nodes, give limited improvement and can even lead to negative transfer on many downstream tasks. In contrast, our strategy avoids negative transfer and improves generalization significantly across downstream tasks, leading up to 9.4% absolute improvements in ROC-AUC over non-pre-trained models and achieving state-of-the-art performance for molecular property prediction and protein function prediction.

For agents

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

get_harvested_code_for_paper("1905.12265")
get_code_for_paper("1905.12265")
have("1905.12265")

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

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

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

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

Connect an agent — have() is free.