| ancestral_hmc |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/sampler/ancestral_hmc.py code served (permissive licence) · get_code("6b8c42eee41f467c") 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 ndarray, ndim 2, dtype family float, shape (2, 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 numpy as np
import torch
import torch.nn as nn
torch.manual_seed(0)
np.random.seed(0)
class StandInTarget(nn.Module):
def __init__(self, dim):
super().__init__()
self.dim = dim
self.cond_data = None
self.cond_node = None
def log_pdf(self, x):
# x shape: (num_samples, dim)
# Return log pdf value for each sample
return np.sum(-0.5 * x**2, axis=1)
def set_cond(self, X_cond, node_idx):
self.cond_data = X_cond
self.cond_node = node_idx
class StandInTransitionKernel(nn.Module):
def __init__(self, target, momentum):
super().__init__()
self.target = target
self.momentum = momentum
def proposal(self, current, current_log_pdf):
# current shape: (num_samples, dim)
# Return: (proposals, acceptance_probs, log_pdf_proposal)
num_samples, dim = current.shape
proposals = current + 0.1 * np.random.randn(num_samples, dim)
log_pdf_proposal = self.target.log_pdf(proposals)
if current_log_pdf is None:
current_log_pdf = self.target.log_pdf(current)
acc_prob = np.exp(np.minimum(0, log_pdf_proposal - current_log_pdf))
return proposals, acc_prob, log_pdf_proposal
# Build target and kernel
target = StandInTarget(dim=4)
momentum = np.array([0.1, 0.1, 0.1, 0.1])
transition_kernel = StandInTransitionKernel(target, momentum)
# Create momentums for each node
momentums = [
np.array([0.1, 0.1]),
np.array([0.1, 0.1, 0.1]),
]
# Build graph: list of (node_coordinates, parent_indices)
# node_coordinates are the output dimension indices for this node
# parent_indices are which dimensions from parents this node depends on
graph = [
([0, 1], []), # Node 0: outputs to dims 0,1, no parents
([2, 3, 4], [0, 1]), # Node 1: outputs to dims 2,3,4, depends on dims 0,1
]
ARGS = {
"transition_kernel": transition_kernel,
"momentums": momentums,
"graph": graph,
"num_samples": 2,
"num_iter": 3,
"recompute_log_pdf": False,
"time_budget": None,
"X_cond": None,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (2, 5) — shape (2, 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
|
| compute_G |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/functions.py code served (permissive licence) · get_code("a7b7c5201116c8c4") 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 ndarray, ndim 2, dtype family float, shape (5, 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 autograd.numpy as np
class MockKernel:
def __init__(self):
self.params = np.array([0.1, 0.2, 0.3, 0.4, 0.5])
def _hessian(self, params, Y, K_X):
# Return a mock Hessian matrix
# params shape: (5,)
# Y shape: (2, 4)
# K_X shape: (2, 3)
# Return a matrix of shape (5, 5)
return np.ones((5, 5))
kernel = MockKernel()
Y = np.random.randn(2, 4)
K_X = np.random.randn(2, 3)
ARGS = {
"kernel": kernel,
"Y": Y,
"K_X": K_X,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- autograd — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (5, 5) — shape (5, 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
|
| compute_h |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/functions.py code served (permissive licence) · get_code("283595c18341b90c") 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 ndarray, ndim 1, dtype family float, shape (8,) 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 autograd.numpy as np
import numpy as onp
class StandInKernel:
def __init__(self):
self.params = np.array([0.1, 0.2, 0.3, 0.4])
def _grad_laplacian(self, params, Y1, Y2, K_X):
n = Y1.shape[0]
d = Y1.shape[1]
return np.zeros((n, d))
def _w_cross_hessian(self, params, Y1, Y2, grad_log_q, K_X):
n = Y1.shape[0]
d = Y1.shape[1]
return np.zeros((n, d))
class StandInBaseDensity:
def grad(self, Y):
n, d = Y.shape
return np.ones((n, d)) * 0.5
kernel = StandInKernel()
base_density = StandInBaseDensity()
Y = np.array([[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]])
K_X = np.eye(2)
ARGS = {
"kernel": kernel,
"base_density": base_density,
"Y": Y,
"K_X": K_X,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- autograd, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (8,) — shape (8,) 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
|
| create_splits |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/tools.py code served (permissive licence) · get_code("c4bc3927f6b150ee") 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 3, dtype family int; 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.model_selection import KFold
torch_seed = 0
# Analyzing the function:
# - Y: passed to kf.split(Y), so needs to be array-like with len()
# - n_split: passed to KFold(n_splits=n_split), should be int > 1
# Create a small Y array
Y = np.array([0, 1, 0, 1, 0, 1, 0, 1]) # 8 samples for proper k-fold splitting
# Create n_split parameter
n_split = 2
ARGS = {
"Y": Y,
"n_split": n_split
}
- 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 3, dtype family int — 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_project_path |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/visualisation.py code served (permissive licence) · get_code("087dda30c5384aeb") 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 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 os
import tempfile
import shutil
# Create a temporary directory structure that simulates a project layout
temp_base = tempfile.mkdtemp()
project_name = "my_project"
project_path = os.path.join(temp_base, project_name)
os.makedirs(project_path, exist_ok=True)
# Change to a subdirectory within the project so that when we split by project_name,
# we get the expected behavior
subdir = os.path.join(project_path, "subdir")
os.makedirs(subdir, exist_ok=True)
original_cwd = os.getcwd()
os.chdir(subdir)
ARGS = {
"project_name": project_name
}
- 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 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
|
| leapfrog |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/sampler/hmc.py code served (permissive licence) · get_code("6c764cff71d22a7d") 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 3, 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
# Define gradient functions for dlogq and dlogp
def dlogq_func(q):
"""Gradient of log q - simple quadratic potential"""
return 2 * q
def dlogp_func(p):
"""Gradient of log p - simple quadratic kinetic energy"""
return p
# Initial position and momentum
q_init = np.array([1.0, 2.0, 3.0, 4.0])
p_init = np.array([0.5, 0.5, 0.5, 0.5])
ARGS = {
"q": q_init,
"dlogq": dlogq_func,
"p": p_init,
"dlogp": dlogp_func,
"step_size": 0.3,
"num_steps": 1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 3, 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
|
| leapfrog_no_storing |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/sampler/hmc.py code served (permissive licence) · get_code("f49dd23ab5abdbce") 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 2, 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
# Define gradient functions for q and p
def dlogq(q):
"""Gradient of log q with respect to q"""
# Simple quadratic potential: returns -q (gradient of 0.5*q^2)
return -q
def dlogp(p):
"""Gradient of log p with respect to p"""
# Simple quadratic potential: returns -p (gradient of 0.5*p^2)
return -p
# Create initial state vectors
q_init = np.array([1.0, 2.0, 3.0, 4.0])
p_init = np.array([0.5, 0.5, 0.5, 0.5])
ARGS = {
"q": q_init,
"dlogq": dlogq,
"p": p_init,
"dlogp": dlogp,
"step_size": 0.3,
"num_steps": 5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, 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
|
| make_graph |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/tools.py code served (permissive licence) · get_code("204340655ddfd3bf") 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. 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)
ARGS = {
'graph_type': 'full',
'd': 4
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, 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
|
| median_heuristic |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/tools.py code served (permissive licence) · get_code("49299f8379dad594") 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 float64, ndim 0, 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 sample data
np.random.seed(0)
data = np.random.randn(5, 6) # 5 samples, 6 features
# Create graph_node structure
# graph_node is expected to be a list of tuples
# graph_node[0][1] should be a list/array of indices indicating which columns to use
graph_node = [(None, [0, 2, 4])] # Use columns 0, 2, 4 from data
ARGS = {
"data": data,
"graph_node": graph_node,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| score |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/functions.py code served (permissive licence) · get_code("841efea8b489cbff") 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 ndarray, 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 autograd.numpy as np
class MockKernelX:
def __init__(self):
self.params = np.array([0.5, 0.3, 0.2])
def _kernel(self, params, X, basis_X):
# Returns K matrix of shape (n_basis, n_x)
n_basis = basis_X.shape[0]
n_x = X.shape[0]
return np.ones((n_basis, n_x))
class MockKernelY:
def __init__(self):
self.params = np.array([0.4, 0.6])
def _cross_laplacian(self, params, Y, basis_Y, K):
# Returns array of shape matching Y
return np.zeros_like(Y)
def _grad_laplacian(self, params, Y, basis_Y, K):
# Returns array of shape matching Y
return np.zeros_like(Y)
def _w_cross_hessian(self, params, Y, basis_Y, w, K):
# Returns array of shape matching Y
return np.zeros_like(Y)
class MockBaseDensity:
def grad(self, X):
# Returns gradient of log density at X
return np.zeros_like(X)
# Create data with distinct dimensions
n_y = 2 # number of Y samples
d_y = 4 # dimension of Y
n_basis = 3 # number of basis points
d_x = 5 # dimension of X
n_x = 2 # number of X samples
X = np.random.randn(n_x, d_x)
Y = np.random.randn(n_y, d_y)
basis_X = np.random.randn(n_basis, d_x)
basis_Y = np.random.randn(n_basis, d_y)
beta = np.random.randn(n_basis, d_y)
kernel_x = MockKernelX()
kernel_y = MockKernelY()
base_density = MockBaseDensity()
lmbda = 0.1
ARGS = {
"kernel_x": kernel_x,
"kernel_y": kernel_y,
"base_density": base_density,
"X": X,
"Y": Y,
"basis_X": basis_X,
"basis_Y": basis_Y,
"beta": beta,
"lmbda": lmbda,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- autograd — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, 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
|
| standard_sqrt_schedule |
Ran ran on a synthesized input |
MichaelArbel/KCEF/KCEF/sampler/hmc.py code served (permissive licence) · get_code("92bf96ecad7e3e6f") 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 float64, ndim 0, 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
def standard_sqrt_schedule(t):
return 1.0 / np.sqrt(t + 1)
# The function takes a single parameter 't' which is used in a mathematical operation
# t can be an integer, float, or numpy array
# Based on the function body, it performs: 1.0 / np.sqrt(t + 1)
ARGS = {
't': 5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| pdf_grid |
Not yet run unverified (harvested, no recorded run) |
MichaelArbel/KCEF/KCEF/visualisation.py code served (permissive licence) · get_code("43c75b84c49c3372") How it ran |
| visualise_fit_2d_cond |
Not yet run unverified (harvested, no recorded run) |
MichaelArbel/KCEF/KCEF/visualisation.py code served (permissive licence) · get_code("958f7df9cc457e08") How it ran |