| choose_activation |
Ran ran; our contract draft was wrong, not the code |
icml2024357/hombasis-gnn/brec/HomGIN/models_misc.py code served (permissive licence) · get_code("8cece8d22b52bc54") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ReLU. 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)
ARGS = {
'activation': 'relu'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
|
| eval |
Ran ran, honoured the contract we drafted |
icml2024357/hombasis-gnn/hombasis-bench/zinc_utils.py code served (permissive licence) · get_code("1abf815848e61eff") How it ranRan 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
import numpy as np
torch.manual_seed(0)
# Define a minimal batch class with required attributes
class Batch:
def __init__(self, x, edge_index, counts, batch, y, dimension=1):
self.x = x
self.edge_index = edge_index
self.counts = counts
self.batch = batch
self.y = y
self.dimension = dimension
self.cochains = {}
for dim in range(dimension + 1):
self.cochains[dim] = type('obj', (object,), {'x': torch.randn(4, 3)})()
def to(self, device):
self.x = self.x.to(device)
self.edge_index = self.edge_index.to(device)
self.counts = self.counts.to(device)
self.batch = self.batch.to(device)
self.y = self.y.to(device)
for dim in range(self.dimension + 1):
self.cochains[dim].x = self.cochains[dim].x.to(device)
return self
# Define a minimal model
class MinimalGraphReg(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(3, 1)
def forward(self, x, edge_index, counts, use_counts, batch):
return self.linear(x).squeeze(-1)
def eval(self):
super().eval()
return self
# Create test data
num_nodes = 4
num_edges = 5
batch_size = 2
x = torch.randn(num_nodes, 3)
edge_index = torch.randint(0, num_nodes, (2, num_edges))
counts = torch.ones(num_nodes, 2)
batch_indices = torch.tensor([0, 0, 1, 1])
y = torch.randn(num_nodes, 1)
batch1 = Batch(x=x.clone(), edge_index=edge_index.clone(), counts=counts.clone(),
batch=batch_indices.clone(), y=y.clone())
batch2 = Batch(x=x.clone(), edge_index=edge_index.clone(), counts=counts.clone(),
batch=batch_indices.clone(), y=y.clone())
loader = [batch1, batch2]
model = MinimalGraphReg()
device = torch.device('cpu')
ARGS = {
'model_name': 'GINGraphReg',
'use_counts': True,
'model': model,
'device': device,
'loader': loader
}
- 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 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
|
| graph6_to_pyg |
Ran ran; our contract draft was wrong, not the code |
icml2024357/hombasis-gnn/brec/ProvablyPowerfulGraphNetworks_torch/BRECDataset_v3.py code served (permissive licence) · get_code("513e5ba0da199b50") How it ranRan 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 networkx as nx
from torch_geometric.utils.convert import from_networkx, to_networkx
torch.manual_seed(0)
# Create a simple graph in graph6 format
# graph6 format is a compact representation of graphs
# We'll create a small graph and encode it to bytes
simple_graph = nx.Graph()
simple_graph.add_edges_from([(0, 1), (1, 2), (2, 0)])
# Convert to graph6 bytes format
graph6_bytes = nx.to_graph6_bytes(simple_graph, header=False)
ARGS = {
"x": graph6_bytes
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- networkx, 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
|
| test |
Ran ran; our contract draft was wrong, not the code |
ejin700/hombasis-gnn/hombasis-bench/run-collab.py code served (permissive licence) · get_code("a6e419d6bf287a8f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) 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
torch.manual_seed(0)
# Define a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
def __init__(self, input_dim, hidden_dim):
super().__init__()
self.linear = nn.Linear(input_dim, hidden_dim)
def forward(self, x, adj_t, use_counts, counts):
# Returns node embeddings of shape [num_nodes, hidden_dim]
return self.linear(x)
def eval(self):
super().eval()
return self
# Define a minimal predictor that takes two node embeddings and returns a score
class MinimalPredictor(nn.Module):
def __init__(self, hidden_dim):
super().__init__()
self.linear = nn.Linear(hidden_dim * 2, 1)
def forward(self, h1, h2):
# Concatenate embeddings and predict link score
combined = torch.cat([h1, h2], dim=-1)
return self.linear(combined)
def eval(self):
super().eval()
return self
# Define a minimal evaluator
class MinimalEvaluator:
def __init__(self):
self.K = 10
def eval(self, input_dict):
# Return hits@K metric
y_pred_pos = input_dict['y_pred_pos']
y_pred_neg = input_dict['y_pred_neg']
# Simple mock evaluation: compute hits based on ranking
hits = (y_pred_pos.mean() > y_pred_neg.mean()).float().item()
return {f'hits@{self.K}': hits}
# Define a minimal data object
class MinimalData:
def __init__(self):
num_nodes = 8
input_dim = 4
self.x = torch.randn(num_nodes, input_dim)
self.adj_t = torch.eye(num_nodes)
self.full_adj_t = torch.eye(num_nodes)
self.use_counts = torch.ones(num_nodes)
self.counts = torch.ones(num_nodes)
# Create instances
num_nodes = 8
input_dim = 4
hidden_dim = 3
batch_size = 2
model = MinimalModel(input_dim, hidden_dim)
predictor = MinimalPredictor(hidden_dim)
data = MinimalData()
evaluator = MinimalEvaluator()
# Create split_edge dictionary with edge tensors
num_train_edges = 4
num_valid_edges = 2
num_test_edges = 2
split_edge = {
'train': {
'edge': torch.randint(0, num_nodes, (num_train_edges, 2))
},
'valid': {
'edge': torch.randint(0, num_nodes, (num_valid_edges, 2)),
'edge_neg': torch.randint(0, num_nodes, (num_valid_edges, 2))
},
'test': {
'edge': torch.randint(0, num_nodes, (num_test_edges, 2)),
'edge_neg': torch.randint(0, num_nodes, (num_test_edges, 2))
}
}
ARGS = {
'model': model,
'predictor': predictor,
'data': data,
'split_edge': split_edge,
'evaluator': evaluator,
'batch_size': batch_size
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- 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
|
| test |
Ran ran, honoured the contract we drafted |
ejin700/hombasis-gnn/qm9/src/experiments/run_gc.py code served (permissive licence) · get_code("5bfd4028374d07c7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.fc = nn.Linear(5, 3)
def forward(self, data):
# data is expected to have some feature attribute
# Return shape (batch_size, num_classes)
x = data.x if hasattr(data, 'x') else torch.randn(data.y.size(0), 5)
return self.fc(x)
class DataObject:
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 model
model = SimpleModel()
# Create loader - list of data objects
data1 = DataObject(torch.randn(2, 5), torch.tensor([0, 1]))
data2 = DataObject(torch.randn(2, 5), torch.tensor([2, 0]))
data3 = DataObject(torch.randn(2, 5), torch.tensor([1, 2]))
loader = [data1, data2, data3]
# Add dataset attribute to loader (needed for len(loader.dataset))
class LoaderWithDataset:
def __init__(self, data_list):
self.data_list = data_list
self.dataset = list(range(sum(d.y.size(0) for d in data_list)))
def __iter__(self):
return iter(self.data_list)
loader = LoaderWithDataset([data1, data2, data3])
ARGS = {
'model': model,
'loader': loader
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- Imports
- 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
|
| train |
Ran ran, honoured the contract we drafted |
ejin700/hombasis-gnn/hombasis-bench/run-collab.py code served (permissive licence) · get_code("b10c2f48c45238a5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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
from torch.utils.data import DataLoader
torch.manual_seed(0)
# Model that takes x, adj_t, use_counts, counts and returns embeddings
class StandInModel(nn.Module):
def __init__(self, in_dim, out_dim):
super().__init__()
self.lin = nn.Linear(in_dim, out_dim)
def forward(self, x, adj_t, use_counts, counts):
return self.lin(x)
# Predictor that takes two node embeddings and returns a score
class StandInPredictor(nn.Module):
def __init__(self, emb_dim):
super().__init__()
self.lin = nn.Linear(emb_dim * 2, 1)
def forward(self, h1, h2):
combined = torch.cat([h1, h2], dim=-1)
return torch.sigmoid(self.lin(combined)).squeeze(-1)
# Create model and predictor
model = StandInModel(in_dim=5, out_dim=4)
predictor = StandInPredictor(emb_dim=4)
# Create data object with required attributes
class StandInData:
def __init__(self):
self.num_nodes = 6
self.x = torch.randn(6, 5) # 6 nodes, 5 features
self.adj_t = torch.randn(6, 6) # adjacency
self.use_counts = torch.ones(6)
self.counts = torch.ones(6)
data = StandInData()
# Create split_edge with train edges
split_edge = {
'train': {
'edge': torch.tensor([[0, 1], [1, 2], [2, 3], [3, 4]], dtype=torch.long) # 4 edges
}
}
# Create optimizer
optimizer = torch.optim.Adam(list(model.parameters()) + list(predictor.parameters()), lr=0.01)
batch_size = 2
ARGS = {
'model': model,
'predictor': predictor,
'data': data,
'split_edge': split_edge,
'optimizer': optimizer,
'batch_size': batch_size
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- Imports
- 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
|
| train |
Ran ran, honoured the contract we drafted |
icml2024357/hombasis-gnn/hombasis-bench/zinc_utils.py code served (permissive licence) · get_code("b367358dc74e5496") How it ranRan 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 torch
import torch.nn as nn
from torch_geometric.data import Data, DataLoader
torch.manual_seed(0)
# Create a minimal GNN model that matches the function's usage
class MinimalGINGraphReg(nn.Module):
def __init__(self):
super().__init__()
self.lin = nn.Linear(4, 1)
def forward(self, x, edge_index, counts, use_counts, batch):
# The function expects pred to have same shape as targets
# targets has shape batch.y reshaped to pred.shape
# So we need to return a tensor with batch size = number of graphs
out = self.lin(x) # [num_nodes, 1]
# Simple global pooling: sum over nodes for each graph
num_graphs = batch.max().item() + 1
graph_out = torch.zeros(num_graphs, 1)
for i in range(num_graphs):
graph_out[i] = out[batch == i].sum()
return graph_out
def train(self):
super().train()
# Create a minimal data batch
def create_batch():
# 2 graphs
x = torch.randn(4, 4) # 4 nodes, 4 features
edge_index = torch.tensor([[0, 1, 2, 3], [1, 2, 3, 0]], dtype=torch.long)
counts = torch.tensor([1.0, 1.0, 1.0, 1.0])
batch = torch.tensor([0, 0, 1, 1]) # 2 nodes in each of 2 graphs
y = torch.randn(2, 1) # 2 graphs, 1 target each
data = Data(x=x, edge_index=edge_index, counts=counts, batch=batch, y=y)
return data
# Create loader with batches
loader = [create_batch(), create_batch()]
# Create model and optimizer
model = MinimalGINGraphReg()
optimizer = torch.optim.Adam(model.parameters(), lr=0.01)
ARGS = {
"model_name": "GINGraphReg",
"use_counts": True,
"model": model,
"device": torch.device("cpu"),
"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, torch_geometric — 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
|
| val |
Ran ran, honoured the contract we drafted |
ejin700/hombasis-gnn/qm9/src/experiments/run_gc.py code served (permissive licence) · get_code("49732bab8713a245") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 simple model
class SimpleModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(5, 3)
def forward(self, data):
# Model expects data object with x attribute
return self.linear(data.x)
model = SimpleModel()
# Create a stand-in data class that mimics PyTorch Geometric Data
class Data:
def __init__(self, x, y, num_graphs):
self.x = x
self.y = y
self.num_graphs = num_graphs
def to(self, device):
# Return self since we're staying on CPU
return self
# Create a simple dataset/loader
# loader should be iterable yielding Data objects
data1 = Data(x=torch.randn(6, 5), y=torch.randn(6, 3), num_graphs=2)
data2 = Data(x=torch.randn(4, 5), y=torch.randn(4, 3), num_graphs=2)
class SimpleLoader:
def __init__(self, data_list):
self.data_list = data_list
self.dataset = self # loader.dataset should exist
def __iter__(self):
return iter(self.data_list)
def __len__(self):
# This should return the total number of graphs in the dataset
return sum(d.num_graphs for d in self.data_list)
loader = SimpleLoader([data1, data2])
# Create a loss function
loss_fun = nn.MSELoss()
ARGS = {
'model': model,
'loader': loader,
'loss_fun': loss_fun
}
- Setup block drafted by
- a language model, Claude Sonnet 4.5, prompt python_fixture_v1
- Imports
- 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
|
| train |
Not yet run unverified (harvested, no recorded run) |
ejin700/hombasis-gnn/qm9/src/experiments/run_gc.py code served (permissive licence) · get_code("d1a3f22e2fe768ac") How it ran |