SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.05828 · ICLR · 2023

Graph Neural Network-Inspired Kernels for Gaussian Processes in Semi-Supervised Learning

Jie Chen, Zehao Niu, Mihai Anitescu

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 4 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2302.05828.json · badge: /api/ran/2302.05828.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
niuzehao/gnn-gp canonical (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
fit Ran
ran on a synthesized input
niuzehao/gnn-gp/src/predict.py
code served (permissive licence) · get_code("1d4c96cb8248baa4")
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 1, dtype family float, shape (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
import torch.nn as nn

torch.manual_seed(0)

# Create a small positive semi-definite kernel matrix (4x4)
# Using a simple construction: K = X @ X.T where X is (4, 3)
X = torch.randn(4, 3)
K = X @ X.T
K = (K + K.T) / 2  # Ensure symmetry

# Create target values for regression (float type)
y = torch.randn(4)

# Create a training mask (4 nodes, selecting 2 for training)
train_mask = torch.tensor([True, True, False, False])

# Nugget parameter
nugget = 0.01

ARGS = {
    "K": K,
    "y": y,
    "train_mask": train_mask,
    "nugget": nugget,
}
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 Tensor, ndim 1, dtype family float, shape (4,) — shape (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
fit_Nystrom Ran
ran on a synthesized input
niuzehao/gnn-gp/src/predict.py
code served (permissive licence) · get_code("ea9e79cd2bcf5357")
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 1, dtype family float, shape (5,) 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 import Tensor

torch.manual_seed(0)

# Create a small Nystrom kernel matrix scenario
# Q is the square root of GNNGP kernel matrix - should be square
n_nodes = 5
n_features = 4

# Create Q as a square matrix (n_nodes x n_nodes)
Q = torch.randn(n_nodes, n_nodes, dtype=torch.float32)

# Create y - can be either int (classification) or float (regression)
# Using float for regression task
y = torch.randn(n_nodes, dtype=torch.float32)

# Create train_mask - boolean mask for training nodes
train_mask = torch.tensor([True, True, False, True, False], dtype=torch.bool)

# nugget can be float or Tensor
nugget = 0.01

ARGS = {
    "Q": Q,
    "y": y,
    "train_mask": train_mask,
    "nugget": nugget,
}
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 Tensor, ndim 1, dtype family float, shape (5,) — shape (5,) 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
get_data Ran
ran on a synthesized input
niuzehao/gnn-gp/src/datasets.py
code served (permissive licence) · get_code("ce03489462b185ee")
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

torch.manual_seed(0)

class MockGraphData:
    def __init__(self):
        # Node features: 2 nodes, 4 features each
        self.x = torch.randn(2, 4)
        # Node labels: 2 nodes
        self.y = torch.tensor([0, 1])
        # Edge index: 3 edges connecting the 2 nodes
        self.edge_index = torch.tensor([[0, 1, 0], [1, 0, 1]], dtype=torch.long)
        # Edge attributes: 3 edges with weights
        self.edge_attr = torch.tensor([0.5, 0.7, 0.3], dtype=torch.float)
        # Masks for train/val/test splits
        self.train_mask = torch.tensor([True, False])
        self.val_mask = torch.tensor([False, True])
        self.test_mask = torch.tensor([False, False])

data = MockGraphData()

ARGS = {
    'data': data
}
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 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
result Ran
ran on a synthesized input
niuzehao/gnn-gp/src/predict.py
code served (permissive licence) · get_code("ef794a53e5bb93f9")
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

torch.manual_seed(0)

# Create a small classification problem with 6 samples, 4 features
n_samples = 6
n_features = 4
n_classes = 3

# Create a kernel matrix (6x6, symmetric positive semi-definite)
K_base = torch.randn(n_samples, n_features)
K = K_base @ K_base.T + torch.eye(n_samples) * 0.1  # Make it SPD
K = (K + K.T) / 2  # Ensure symmetry

# Create classification targets (integer labels)
y = torch.tensor([0, 1, 2, 0, 1, 2], dtype=torch.int64)

# Create masks for train, validation, test
train_mask = torch.tensor([True, True, False, False, False, False])
val_mask = torch.tensor([False, False, True, True, False, False])
test_mask = torch.tensor([False, False, False, False, True, True])

masks = {
    'train': train_mask,
    'val': val_mask,
    'test': test_mask
}

# Call fit to generate predictions
fit_output = torch.torch.linalg.eigh(K[train_mask][:, train_mask])
w, v = fit_output
d = torch.mean(torch.diag(K))
yb = torch.nn.functional.one_hot(y[train_mask]).to(torch.float)
nugget = torch.tensor([0.01])
shape = (-1, 1) if len(yb.shape) >= 2 else (-1,)
temp = v.T @ yb
fitted = torch.zeros((len(nugget), K.shape[0], *yb.shape[1:]), device=K.device)
for i, eps in enumerate(nugget):
    fitted[i] = K[:, train_mask] @ (v @ (temp / (w + eps * d).view(shape)))
fit_result = fitted[0] if len(nugget) == 1 else fitted

# Prepare the fit tensor with proper shape for result function
# It should have shape (num_nugget, n_samples, n_classes) for classification
if len(fit_result.shape) == 2:
    fit_result = fit_result.unsqueeze(0)

ARGS = {
    'fit': fit_result,
    'y': y,
    'masks': masks
}
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 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
main_gnn Not yet run
unverified (harvested, no recorded run)
niuzehao/gnn-gp/src/main_gnn.py
code served (permissive licence) · get_code("cd3621ee0ed8ee24")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 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.

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

Gaussian processes (GPs) are an attractive class of machine learning models because of their simplicity and flexibility as building blocks of more complex Bayesian models. Meanwhile, graph neural networks (GNNs) emerged recently as a promising class of models for graph-structured data in semi-supervised learning and beyond. Their competitive performance is often attributed to a proper capturing of the graph inductive bias. In this work, we introduce this inductive bias into GPs to improve their predictive performance for graph-structured data. We show that a prominent example of GNNs, the graph convolutional network, is equivalent to some GP when its layers are infinitely wide; and we analyze the kernel universality and the limiting behavior in depth. We further present a programmable procedure to compose covariance kernels inspired by this equivalence and derive example kernels corresponding to several interesting members of the GNN family. We also propose a computationally efficient approximation of the covariance matrix for scalable posterior inference with large-scale data. We demonstrate that these graph-based kernels lead to competitive classification and regression performance, as well as advantages in computation time, compared with the respective GNNs.

For agents

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

get_harvested_code_for_paper("2302.05828")
get_code_for_paper("2302.05828")
have("2302.05828")

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

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

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

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

Connect an agent — have() is free.