SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.04501 · ICML · 2023

SEGA: Structural Entropy Guided Anchor View for Graph Contrastive Learning

Ke Xu, Bowen Shi, Junran Wu, Xueyuan Chen, Shangzhe Li

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 5 failures of our instrument; 1 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/2305.04501.json · badge: /api/ran/2305.04501.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
wu-junran/sega canonical (classifier label)
classifier basis: classifier_2025
8 ran · 1 no recorded run
FunctionStatusWhere it lives
CombineDelta Ran
ran, honoured the contract we drafted
wu-junran/sega/unsupervised_TU/codingTree.py
code served (permissive licence) · get_code("de84476db7dd33cf")
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 math

class Node:
    def __init__(self, vol, g):
        self.vol = vol
        self.g = g

node1 = Node(vol=10, g=3)
node2 = Node(vol=15, g=5)
cut_v = 2
g_vol = 50

ARGS = {
    "node1": node1,
    "node2": node2,
    "cut_v": cut_v,
    "g_vol": g_vol
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
CompressDelta Ran
ran, honoured the contract we drafted
wu-junran/sega/unsupervised_TU/codingTree.py
code served (permissive licence) · get_code("8335fd74dc310937")
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 math

class Node:
    def __init__(self, child_cut, vol):
        self.child_cut = child_cut
        self.vol = vol

node1 = Node(child_cut=2.5, vol=10)
p_node = Node(child_cut=1.0, vol=5)

ARGS = {
    'node1': node1,
    'p_node': p_node
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
PartitionTreeV2 Ran
ran on a synthesized input · constructed an object; no result was computed
wu-junran/sega/unsupervised_TU/codingTree.py
code served (permissive licence) · get_code("8811a40392658c9f")
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, PartitionTreeV2: 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 numpy as np
import math

class PartitionTreeNode:
    def __init__(self, ID, partition, vol, g, children=None, parent=None, child_h=0, child_cut=0):
        self.ID = ID
        self.partition = partition
        self.parent = parent
        self.children = children if children is not None else set()
        self.vol = vol
        self.g = g
        self.merged = False
        self.child_h = child_h
        self.child_cut = child_cut

    def __str__(self):
        return '{' + '{}:{}'.format(self.__class__.__name__, self.gatherAttrs()) + '}'

    def gatherAttrs(self):
        return ','.join(('{}={}'.format(k, getattr(self, k)) for k in self.__dict__.keys()))

# Create a small adjacency matrix for testing
# 4x4 sparse matrix representing a simple graph
adj_matrix = np.array([
    [0, 1, 0, 0],
    [1, 0, 2, 0],
    [0, 2, 0, 1],
    [0, 0, 1, 0]
], dtype=np.float32)

ARGS = {
    "adj_matrix": adj_matrix
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PartitionTreeV2 — 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 PartitionTreeV2 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
drop_nodes Ran
ran; our contract draft was wrong, not the code
wu-junran/sega/unsupervised_TU/aug.py
code served (permissive licence) · get_code("33da216971e030f9")
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) 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)
np.random.seed(0)

class MockData:
    def __init__(self):
        # node_num = 10, feature_dim = 4
        self.x = torch.randn(10, 4)
        # edge_index: 2 x edge_num
        self.edge_index = torch.tensor([
            [0, 1, 2, 3, 4, 5],
            [1, 2, 3, 4, 5, 6]
        ], dtype=torch.long)

data = MockData()

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
permute_edges Ran
ran; our contract draft was wrong, not the code
wu-junran/sega/unsupervised_TU/aug.py
code served (permissive licence) · get_code("5cc1437e6af51bc4")
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) 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):
        # x: node features, shape (node_num, feature_dim)
        self.x = torch.randn(5, 4)
        # edge_index: shape (2, edge_num)
        self.edge_index = torch.tensor([
            [0, 1, 2, 3, 4, 0, 1],
            [1, 2, 3, 4, 0, 2, 3]
        ], dtype=torch.long)

data = MockData()

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
randomforest_classify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wu-junran/sega/unsupervised_TU/evaluate_embedding.py
code served (permissive licence) · get_code("589e7c44131e0c22")
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) 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 numpy as np
from sklearn.datasets import make_classification

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

# Create a small synthetic dataset
n_samples = 20
n_features = 4
x, y = make_classification(
    n_samples=n_samples,
    n_features=n_features,
    n_informative=3,
    n_redundant=1,
    n_classes=2,
    random_state=0
)

# Convert to numpy arrays with appropriate types
x = np.array(x, dtype=np.float32)
y = np.array(y, dtype=np.int32)

ARGS = {
    'x': x,
    'y': y,
    'search': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy, pandas, seaborn, sklearn, torch — 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
subgraph Ran
ran; our contract draft was wrong, not the code
wu-junran/sega/unsupervised_TU/aug.py
code served (permissive licence) · get_code("82656aebda7aec5b")
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) 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, x, edge_index):
        self.x = x
        self.edge_index = edge_index

# Create a small graph with 10 nodes and some edges
node_num = 10
feature_dim = 4

# Create node features
x = torch.randn(node_num, feature_dim)

# Create edge index - edges as [source_nodes, target_nodes]
# Create a simple graph with some edges
edge_list = [
    [0, 1], [1, 2], [2, 3], [3, 4], [4, 5],
    [5, 6], [6, 7], [7, 8], [8, 9], [0, 5],
    [1, 6], [2, 7], [3, 8], [4, 9]
]
edge_index = torch.tensor(edge_list, dtype=torch.long).t().contiguous()

# Create data object
data = MockData(x=x, edge_index=edge_index)

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
svc_classify Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
wu-junran/sega/unsupervised_TU/evaluate_embedding.py
code served (permissive licence) · get_code("4f29b7d00e11ae45")
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) 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 numpy as np
import torch

torch.manual_seed(0)
np.random.seed(0)

# Create small sample data
n_samples = 20
n_features = 4
x = np.random.randn(n_samples, n_features).astype(np.float32)
y = np.random.randint(0, 2, n_samples)

ARGS = {
    'x': x,
    'y': y,
    'search': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
matplotlib, numpy, pandas, seaborn, sklearn, torch — 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
logistic_classify Not yet run
unverified (harvested, no recorded run)
wu-junran/sega/unsupervised_TU/evaluate_embedding.py
code served (permissive licence) · get_code("6b9fd20aae72d753")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 5 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
drop_nodes 1 other paper
1 later
2312.10401 (2023-12)
Rethinking Dimensional Rationale in Graph Contrastive Learning from Causal Perspective
logistic_classify 1 other paper
1 later
2311.02687 (2023-11)
Architecture Matters: Uncovering Implicit Mechanisms in Graph Contrastive Learning
permute_edges 1 other paper
1 later
2312.10401 (2023-12)
Rethinking Dimensional Rationale in Graph Contrastive Learning from Causal Perspective
subgraph 1 other paper
1 later
2312.10401 (2023-12)
Rethinking Dimensional Rationale in Graph Contrastive Learning from Causal Perspective

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

In contrastive learning, the choice of "view" controls the information that the representation captures and influences the performance of the model. However, leading graph contrastive learning methods generally produce views via random corruption or learning, which could lead to the loss of essential information and alteration of semantic information. An anchor view that maintains the essential information of input graphs for contrastive learning has been hardly investigated. In this paper, based on the theory of graph information bottleneck, we deduce the definition of this anchor view; put differently, the anchor view with essential information of input graph is supposed to have the minimal structural uncertainty. Furthermore, guided by structural entropy, we implement the anchor view, termed SEGA, for graph contrastive learning. We extensively validate the proposed anchor view on various benchmarks regarding graph classification under unsupervised, semi-supervised, and transfer learning and achieve significant performance boosts compared to the state-of-the-art methods.

For agents

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

get_harvested_code_for_paper("2305.04501")
get_code_for_paper("2305.04501")
have("2305.04501")

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

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

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

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

Connect an agent — have() is free.