SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.05087 · 2024

Bootstrap Latents of Nodes and Neighbors for Graph Self-Supervised Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 0 have no contract verdict; 7 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2408.05087.json · badge: /api/ran/2408.05087.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
cloudy1225/blnn canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
compute_representations Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/bgrl.py
code served (permissive licence) · get_code("88c2733c063d14d3")
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. 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

torch.manual_seed(0)

# Create a minimal neural network that takes a batch of data and returns representations
class MinimalNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal data object with x and y attributes
class DataBatch:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
    def to(self, device):
        self.x = self.x.to(device)
        self.y = self.y.to(device)
        return self

# Create a dataset (list of batches)
# Each item should have .to(device) method and .y attribute for labels
dataset = [
    DataBatch(torch.randn(2, 4), torch.tensor([0, 1])),
    DataBatch(torch.randn(2, 4), torch.tensor([1, 0]))
]

# Create net instance
net = MinimalNet()

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

# However, the function calls net(data) directly, not net(data.x)
# So we need to modify our DataBatch to be callable or make the net handle it differently
# Looking at the code: reps.append(net(data)) - it passes data directly to net
# And data.y is accessed for labels
# So data must be both passable to net AND have a .y attribute

class DataBatchForNet:
    def __init__(self, x, y):
        self.x = x
        self.y = y
    
    def to(self, device):
        new_batch = DataBatchForNet(self.x.to(device), self.y.to(device))
        return new_batch

class NetWrapper(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, data):
        # If data is a DataBatchForNet object, extract x
        if hasattr(data, 'x'):
            return self.linear(data.x)
        else:
            return self.linear(data)

dataset = [
    DataBatchForNet(torch.randn(2, 4), torch.tensor([0, 1])),
    DataBatchForNet(torch.randn(2, 4), torch.tensor([1, 0]))
]

net = NetWrapper()
device = torch.device('cpu')

ARGS = {
    'net': net,
    'dataset': dataset,
    'device': device
}
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 list — a list 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
fit_logistic_regression Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/logistic_regression_eval.py
code served (permissive licence) · get_code("e6696b223b33ae73")
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 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 numpy as np

# Create small sample data
np.random.seed(0)
n_samples = 10
n_features = 4
n_classes = 3

# X: feature matrix (n_samples, n_features)
X = np.random.randn(n_samples, n_features).astype(np.float64)

# y: class labels (n_samples,) - integers from 0 to n_classes-1
y = np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0]).astype(np.int64)

ARGS = {
    'X': X,
    'y': y,
    'data_random_seed': 1,
    'repeat': 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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 float — 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
fit_logistic_regression_preset_splits Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cloudy1225/blnn/bgrl/logistic_regression_eval.py
code served (permissive licence) · get_code("9cc1ab4d7141443c")
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 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small synthetic data
n_samples = 10
n_features = 4
n_classes = 3
n_splits = 2

# X: feature matrix (10 samples, 4 features)
X = np.random.randn(n_samples, n_features).astype(np.float32)

# y: class labels (10 samples,) with values in {0, 1, 2}
y = np.array([0, 1, 2, 0, 1, 2, 0, 1, 2, 0], dtype=np.int64)

# train_masks: boolean masks for training set (10 samples, 2 splits)
train_masks = np.array([
    [True, False, True, False, True, False, True, False, True, False],
    [False, True, False, True, False, True, False, True, False, True]
]).T.astype(bool)

# val_masks: boolean masks for validation set (10 samples, 2 splits)
val_masks = np.array([
    [False, True, False, True, False, True, False, True, False, True],
    [True, False, True, False, True, False, True, False, True, False]
]).T.astype(bool)

# test_mask: boolean mask for test set (10 samples,)
test_mask = np.array([False, False, False, False, False, True, True, True, True, True], dtype=bool)

ARGS = {
    'X': X,
    'y': y,
    'train_masks': train_masks,
    'val_masks': val_masks,
    'test_mask': test_mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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 float — 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
get_graph_drop_transform Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/transforms.py
code served (permissive licence) · get_code("6eb314269b842f3d")
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 Compose. 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 copy
from torch_geometric.utils.dropout import dropout_edge
from torch_geometric.transforms import Compose

torch.manual_seed(0)

# Set up arguments for get_graph_drop_transform
ARGS = {
    "drop_edge_p": 0.3,
    "drop_feat_p": 0.2,
}
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 Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
get_logger Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/utils.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Cloudy1225/SSGE, is pointer only (licence: NONE) · get_code("d15ddbe73962ac64")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Cloudy1225/SSGE, 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.

get_wiki_cs Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/data.py
code served (permissive licence) · get_code("436013cac49fa475")
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 torch
import numpy as np
from torch_geometric.transforms import NormalizeFeatures
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create a mock dataset that mimics WikiCS structure
mock_data = Mock()
mock_data.x = torch.randn(2, 4)  # 2 nodes, 4 features
mock_data.edge_index = torch.tensor([[0, 1], [1, 0]], dtype=torch.long)  # 2 edges
mock_data.train_mask = torch.tensor([True, False], dtype=torch.bool)
mock_data.val_mask = torch.tensor([False, True], dtype=torch.bool)
mock_data.test_mask = torch.tensor([False, False], dtype=torch.bool)

mock_dataset = Mock()
mock_dataset.__getitem__ = Mock(return_value=mock_data)

# Patch the WikiCS dataset loader
import torch_geometric.datasets as datasets_module
original_wikics = datasets_module.WikiCS
datasets_module.WikiCS = Mock(return_value=mock_dataset)

# Define arguments
ARGS = {
    'root': '/tmp/wiki_cs',
    'transform': NormalizeFeatures()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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 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
node_clustering Ran
ran; our contract draft was wrong, not the code
cloudy1225/blnn/bgrl/utils.py
code served (permissive licence) · get_code("c7bf9bd5dc9a2b1b")
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 str. 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)

# Z: node representations tensor - needs to be normalized and converted to numpy
# Shape: (num_nodes, embedding_dim) - using small values
Z = torch.randn(8, 4)

# Y: node labels/classes - needs unique() method and detach().cpu().numpy()
# Create labels with a few distinct classes
Y = torch.tensor([0, 0, 1, 1, 2, 2, 0, 1])

ARGS = {
    "Z": Z,
    "Y": Y,
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_dataset Not yet run
unverified (harvested, no recorded run)
cloudy1225/blnn/bgrl/data.py
code served (permissive licence) · get_code("8021d44d3b828d80")
How it ran

no invocation recorded.

load_trained_encoder Not yet run
unverified (harvested, no recorded run)
cloudy1225/blnn/bgrl/bgrl.py
code served (permissive licence) · get_code("d0852bc7decfea66")
How it ran

no invocation recorded.

ppi_train_linear_layer Not yet run
unverified (harvested, no recorded run)
cloudy1225/blnn/bgrl/linear_eval_ppi.py
code served (permissive licence) · get_code("a071438db1f34e7b")
How it ran

no invocation recorded.

similarity_search Not yet run
unverified (harvested, no recorded run)
cloudy1225/blnn/bgrl/utils.py
code served (permissive licence) · get_code("b61442760562ddc6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 7 later) and 4 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
get_graph_drop_transform 3 other papers
1 dated earlier, 2 later
2312.02619 (2023-12)
Rethinking and Simplifying Bootstrapped Graph Latents
2506.15698 (2025-06)
Global Context-aware Representation Learning for Spatially Resolved Transcriptomics
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing
compute_representations 2 other papers
1 dated earlier, 1 later
2312.02619 (2023-12)
Rethinking and Simplifying Bootstrapped Graph Latents
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing
get_logger 2 other papers
1 the same month, 1 later
2408.03765 (2024-08)
Reliable Node Similarity Matrix Guided Contrastive Graph Clustering
2411.01157 (2024-11)
Negative-Free Self-Supervised Gaussian Embedding of Graphs
load_trained_encoder 2 other papers
1 dated earlier, 1 later
2312.02619 (2023-12)
Rethinking and Simplifying Bootstrapped Graph Latents
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing
get_dataset 1 other paper
1 later
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing
get_wiki_cs 1 other paper
1 later
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing
ppi_train_linear_layer 1 other paper
1 later
2606.10284 (2026-06)
Revisiting Positive Samples in Graph Contrastive Learning: From the Perspective of Message Passing

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-22.

Repositories linked to this paper

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

Abstract

Contrastive learning is a significant paradigm in graph self-supervised learning. However, it requires negative samples to prevent model collapse and learn discriminative representations. These negative samples inevitably lead to heavy computation, memory overhead and class collision, compromising the representation learning. Recent studies present that methods obviating negative samples can attain competitive performance and scalability enhancements, exemplified by bootstrapped graph latents (BGRL). However, BGRL neglects the inherent graph homophily, which provides valuable insights into underlying positive pairs. Our motivation arises from the observation that subtly introducing a few ground-truth positive pairs significantly improves BGRL. Although we can't obtain ground-truth positive pairs without labels under the self-supervised setting, edges in the graph can reflect noisy positive pairs, i.e., neighboring nodes often share the same label. Therefore, we propose to expand the positive pair set with node-neighbor pairs. Subsequently, we introduce a cross-attention module to predict the supportiveness score of a neighbor with respect to the anchor node. This score quantifies the positive support from each neighboring node, and is encoded into the training objective. Consequently, our method mitigates class collision from negative and noisy positive samples, concurrently enhancing intra-class compactness. Extensive experiments are conducted on five benchmark datasets and three downstream task node classification, node clustering, and node similarity search. The results demonstrate that our method generates node representations with enhanced intra-class compactness and achieves state-of-the-art performance.

For agents

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

get_harvested_code_for_paper("2408.05087")
get_code_for_paper("2408.05087")
have("2408.05087")

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

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

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

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

Connect an agent — have() is free.