| _config_tf_loader |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("57022752f9995f59") 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 _PrefetchDataset. 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 tensorflow as tf
import numpy as np
# Create a simple tf.data.Dataset
def create_dummy_dataset():
# Create some dummy data
x_data = np.random.randn(100, 4).astype(np.float32)
y_data = np.random.randint(0, 2, 100).astype(np.int32)
# Create a tf.data.Dataset
dataset = tf.data.Dataset.from_tensor_slices((x_data, y_data))
return dataset
loader = create_dummy_dataset()
ARGS = {
"loader": loader,
"batch_size": 16,
"shuffle_size": 50000,
"seed": 42,
"drop_remainder": True
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type _PrefetchDataset — a _PrefetchDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _PrefetchDataset 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
|
| _create_tf_loader |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("5d8c2870379d3384") 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 _PrefetchDataset. 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 tensorflow as tf
# Create small numpy arrays for x_data and y_data
x_data = np.random.randn(10, 4).astype(np.float32)
y_data = np.random.randint(0, 2, size=(10,)).astype(np.int32)
ARGS = {
"x_data": x_data,
"y_data": y_data,
"batch_size": 2,
"shuffle_size": 50000,
"seed": 42,
"drop_remainder": True,
"cache": False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type _PrefetchDataset — a _PrefetchDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _PrefetchDataset 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
|
| _load_movielens_100k |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("09495c898e5d8e94") 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. 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
from pathlib import Path
import pandas as pd
import tempfile
import os
# Create a temporary directory and a minimal u.data file
temp_dir = tempfile.mkdtemp()
data_file = Path(temp_dir) / 'u.data'
# Create a minimal MovieLens 100k format file
# Format: user_id item_id rating timestamp
data_content = """1\t1\t5\t874965758
1\t2\t3\t874965759
2\t1\t4\t874965760
2\t3\t2\t874965761
3\t2\t5\t874965762
"""
with open(data_file, 'w') as f:
f.write(data_content)
ARGS = {
'data_dir': temp_dir
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas — 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
|
| bce_loss |
Ran ran, honoured the contract we drafted |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("b3407cf1906789ea") 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 ArrayImpl, 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 jax
import jax.numpy as jnp
import optax
from typing import NamedTuple
# Create a minimal JAX model that has an apply method
class SimpleModel:
def apply(self, params, inputs):
# Simple linear transformation: params['w'] @ inputs.T
return jnp.dot(inputs, params['w'])
# Create small test data
batch_size = 2
input_dim = 4
output_dim = 3
# Initialize random key for reproducibility
key = jax.random.PRNGKey(0)
# Create simple params dict with weight matrix
params = {
'w': jax.random.normal(key, shape=(input_dim, output_dim))
}
# Create model instance
model = SimpleModel()
# Create batch: (inputs, targets)
# inputs shape: (batch_size, input_dim)
# targets shape: (batch_size, output_dim) - for binary cross entropy, values should be in [0, 1]
inputs = jax.random.normal(key, shape=(batch_size, input_dim))
targets = jax.random.uniform(key, shape=(batch_size, output_dim), minval=0.0, maxval=1.0)
batch = (inputs, targets)
ARGS = {
'model': model,
'params': params,
'batch': batch
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, optax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, 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
|
| global_l2_clip |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("735e56344d7303e1") 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 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 jax.numpy as jnp
import numpy as np
# Create test tensors with distinct sizes
tensor1 = jnp.array([[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]], dtype=jnp.float32)
tensor2 = jnp.array([9.0, 10.0, 11.0, 12.0], dtype=jnp.float32)
tensor3 = jnp.array([[[13.0, 14.0],
[15.0, 16.0],
[17.0, 18.0],
[19.0, 20.0]]], dtype=jnp.float32)
# Create a nested structure using a dictionary (a valid pytree in JAX)
tensor_struct = {
'layer1': tensor1,
'layer2': tensor2,
'layer3': tensor3
}
clip_value = 1.0
ARGS = {
'tensor_struct': tensor_struct,
'clip': clip_value
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — 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
|
| global_l2_norm_sq |
Ran ran, honoured the contract we drafted |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("bbd8d1efcf5829de") 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 ArrayImpl, 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 jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# The function expects a tensor_struct which is any pytree of JAX arrays
# Looking at the function body:
# - struct_flatten is called on tensor_struct
# - tree_flatten extracts tensors and tree definition
# - tensors are reshaped and concatenated
# - the flat vector is used in a dot product
# Create a simple tensor struct - can be a single array, list, dict, or nested structure
tensor_struct_single = jnp.array([1.0, 2.0, 3.0, 4.0])
# Or as a list of arrays (more complex pytree)
tensor_struct_list = [
jnp.array([[1.0, 2.0], [3.0, 4.0]]),
jnp.array([5.0, 6.0, 7.0, 8.0])
]
# Or as a dict (another valid pytree)
tensor_struct_dict = {
'weights': jnp.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
'bias': jnp.array([0.1, 0.2, 0.3, 0.4])
}
# Use the dict version as it's a good representative of a complex struct
ARGS = {
'tensor_struct': tensor_struct_dict
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, 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
|
| logreg_classify |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("26f3490ca9bbe47e") 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 ArrayImpl, ndim 1, dtype family float, shape (2,) 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 jax.numpy as jnp
import jax
from jax.scipy.special import expit as sigmoid
# Define a minimal JAX model that has an apply method
class SimpleLogisticRegression:
def __init__(self):
self.params = None
def apply(self, params, inputs):
# Simple linear model: inputs @ weights + bias
weights = params['weights']
bias = params['bias']
return jnp.dot(inputs, weights) + bias
# Create model instance
model = SimpleLogisticRegression()
# Create parameters: weights (4,) and bias (1,)
params = {
'weights': jnp.array([0.1, 0.2, -0.15, 0.05]),
'bias': jnp.array([0.0])
}
# Create batch inputs: (2, 4) - batch of 2 samples, 4 features
batch_inputs = jnp.array([
[1.0, 2.0, 3.0, 4.0],
[0.5, 1.5, 2.5, 3.5]
])
# Define ARGS dict
ARGS = {
'model': model,
'params': params,
'batch_inputs': batch_inputs,
'temperature': 1.0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 1, dtype family float, shape (2,) — shape (2,) 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
|
| movielens_loader |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("c3b75484cf237418") 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 numpy as np
import scipy as sp
import tensorflow as tf
from pathlib import Path
import tempfile
import os
# Create a temporary directory with minimal MovieLens data
temp_dir = tempfile.mkdtemp()
data_subdir = os.path.join(temp_dir, 'movielens_100k')
os.makedirs(data_subdir, exist_ok=True)
# Create minimal u.data file with a few ratings
u_data_content = """1 1 5 874965758
1 2 3 874965759
2 1 4 874965760
2 2 2 874965761
3 1 5 874965762
3 3 1 874965763
4 2 3 874965764
4 3 4 874965765
"""
with open(os.path.join(data_subdir, 'u.data'), 'w') as f:
f.write(u_data_content)
ARGS = {
'batch_size': 2,
'matfac_dim_1': 4,
'matfac_dim_2': 3,
'density': 0.5,
'seed': 42,
'split': 'train',
'data_dir': data_subdir,
'is_eval': False,
'drop_remainder': True,
'public_split': 0.0,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, pandas, scipy, tensorflow — 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
|
| mse_loss |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("f320dea1d5541ada") 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 ArrayImpl, 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 jax
import jax.numpy as jnp
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create a minimal JAX model that has an apply method
class SimpleModel:
def apply(self, params, inputs):
# Simple linear transformation: inputs @ params
return jnp.dot(inputs, params)
# Create model instance
model = SimpleModel()
# Create params as a JAX array (2D weight matrix)
# inputs will be (batch_size=2, input_dim=4), so params should be (4, 3)
params = jnp.array([
[0.1, 0.2, 0.3],
[0.4, 0.5, 0.6],
[0.7, 0.8, 0.9],
[1.0, 1.1, 1.2]
], dtype=jnp.float32)
# Create batch: (inputs, targets)
# inputs shape: (batch_size=2, input_dim=4)
# targets shape: (batch_size=2, output_dim=3) - same as preds
inputs = jnp.array([
[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]
], dtype=jnp.float32)
targets = jnp.array([
[1.5, 2.5, 3.5],
[4.5, 5.5, 6.5]
], dtype=jnp.float32)
batch = (inputs, targets)
ARGS = {
"model": model,
"params": params,
"batch": batch,
"squeeze": True
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, 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
|
| num_params |
Ran ran, honoured the contract we drafted |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("af4f5b33931d44c0") 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 int64, ndim 0, dtype family int, 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 numpy as np
import torch
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
torch.manual_seed(0)
# The function num_params takes a struct and uses tree_flatten on it
# to get a flat list of parameters, then sums their sizes.
# We need to create a JAX-compatible pytree structure with numeric arrays/tensors
# Create a simple nested structure with JAX arrays or numpy arrays
struct = {
'layer1': np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
'layer2': {
'weights': np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0], [7.0, 8.0]]),
'bias': np.array([0.1, 0.2])
},
'params': np.array([1.5, 2.5, 3.5, 4.5])
}
ARGS = {
'struct': struct
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int64, ndim 0, dtype family int, 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
|
| privatize_grad |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("591c9ea59777949b") 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 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 jax
import jax.numpy as jnp
from jax import random
# Set seed for reproducibility
key = random.PRNGKey(0)
# Create example gradients as a PyTree (nested structure of arrays)
# Simulate per-example gradients with batch_size=2
batch_size = 2
example_grads = {
'layer1': jnp.ones((batch_size, 4)),
'layer2': jnp.ones((batch_size, 3)),
}
# Define parameters for the privatize_grad function
clip = 1.0
noise_mult = 0.5
ARGS = {
'example_grads': example_grads,
'key': key,
'clip': clip,
'noise_mult': noise_mult,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| stackoverflow_tag_loader |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("19770acf0fa0aa44") 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 numpy as np
from pathlib import Path
import tempfile
import os
# Create temporary directory with mock data files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'stackoverflow_tag')
os.makedirs(data_dir, exist_ok=True)
# Create small mock numpy arrays for x and y data
num_samples = 8
x_train = np.random.randn(num_samples, 10000).astype(np.float32)
y_train = np.random.randint(0, 100, num_samples).astype(np.int64)
x_test = np.random.randn(4, 10000).astype(np.float32)
y_test = np.random.randint(0, 100, 4).astype(np.int64)
# Save the mock data
np.save(os.path.join(data_dir, 'x_train.npy'), x_train)
np.save(os.path.join(data_dir, 'y_train.npy'), y_train)
np.save(os.path.join(data_dir, 'x_test.npy'), x_test)
np.save(os.path.join(data_dir, 'y_test.npy'), y_test)
# Define arguments dictionary
ARGS = {
'batch_size': 2,
'split': 'train',
'data_dir': data_dir,
'is_eval': False,
'seed': 42,
'drop_remainder': True,
'public_split': 0.0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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
|
| stackoverflow_tag_loader_cached |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("919aea51fdf26b6d") 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 numpy as np
from pathlib import Path
import tempfile
import os
# Create a temporary directory for fake data files
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'stackoverflow_tag')
os.makedirs(data_dir, exist_ok=True)
# Create small fake numpy arrays for x_train.npy and y_train.npy
x_train = np.random.randn(10, 4).astype(np.float32)
y_train = np.random.randint(0, 2, (10, 3)).astype(np.int32)
x_test = np.random.randn(8, 4).astype(np.float32)
y_test = np.random.randint(0, 2, (8, 3)).astype(np.int32)
# Save the fake data
np.save(os.path.join(data_dir, 'x_train.npy'), x_train)
np.save(os.path.join(data_dir, 'y_train.npy'), y_train)
np.save(os.path.join(data_dir, 'x_test.npy'), x_test)
np.save(os.path.join(data_dir, 'y_test.npy'), y_test)
ARGS = {
'batch_size': 2,
'split': 'train',
'data_dir': data_dir,
'is_eval': False,
'seed': 42,
'drop_remainder': True,
'public_split': 0.0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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
|
| struct_add |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("cca3cf0b80500ec6") 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 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 jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# struct_add takes two arguments: struct_1 and struct_2
# The function uses tree_map(jnp.add, struct_1, struct_2)
# This means both arguments should be pytree structures containing JAX arrays
# We'll create two nested pytrees with small JAX arrays
struct_1 = {
'a': jnp.array([1.0, 2.0, 3.0, 4.0]),
'b': {
'nested': jnp.array([[1.0, 2.0], [3.0, 4.0]])
},
'c': jnp.array([5.0, 6.0])
}
struct_2 = {
'a': jnp.array([0.5, 1.5, 2.5, 3.5]),
'b': {
'nested': jnp.array([[0.5, 1.5], [2.5, 3.5]])
},
'c': jnp.array([1.0, 2.0])
}
ARGS = {
'struct_1': struct_1,
'struct_2': struct_2
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_add_scalar |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("34bf4ad4230cf55d") 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 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 jax
import jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
@jit
def struct_add_scalar(struct, value):
t_list, tree_def = tree_flatten(struct)
new_t_list = [t + value for t in t_list]
return tree_unflatten(tree_def, new_t_list)
# Create a nested structure (dict of arrays) as the struct parameter
struct = {
"a": jnp.array([1.0, 2.0, 3.0, 4.0]),
"b": jnp.array([5.0, 6.0]),
"nested": {
"c": jnp.array([7.0, 8.0, 9.0])
}
}
# Create a scalar value to add
value = 10.0
ARGS = {
"struct": struct,
"value": value
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_div |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("7d340e00912389f7") 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 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 jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# Create two nested structures with JAX arrays
# struct_div divides corresponding elements in two tree structures
struct_1 = {
'a': jnp.array([4.0, 8.0, 12.0, 16.0]),
'b': jnp.array([[2.0, 4.0], [6.0, 8.0]]),
'c': (jnp.array([1.0, 2.0, 3.0]), jnp.array([4.0, 5.0]))
}
struct_2 = {
'a': jnp.array([2.0, 2.0, 3.0, 4.0]),
'b': jnp.array([[1.0, 2.0], [2.0, 4.0]]),
'c': (jnp.array([1.0, 1.0, 1.0]), jnp.array([2.0, 1.0]))
}
ARGS = {
'struct_1': struct_1,
'struct_2': struct_2
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_div_scalar |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("e488dedf8e381c96") 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 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 jax
import jax.numpy as jnp
from jax.tree_util import tree_flatten, tree_unflatten
# Create a test structure - can be nested dicts/lists/tuples of arrays
struct = {
'a': jnp.array([1.0, 2.0, 3.0, 4.0]),
'b': jnp.array([[5.0, 6.0], [7.0, 8.0]]),
'nested': {
'c': jnp.array([9.0, 10.0, 11.0, 12.0])
}
}
factor = 2.0
ARGS = {
'struct': struct,
'factor': factor
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_flatten |
Ran ran, honoured the contract we drafted |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("155ccee594f8679d") 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 ArrayImpl, ndim 1, dtype family float, shape (16,) 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 jax
import jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# Create a test struct - can be a nested dict/list of arrays
test_struct = {
'a': jnp.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
'b': jnp.array([7.0, 8.0]),
'c': {
'nested': jnp.array([[9.0, 10.0], [11.0, 12.0], [13.0, 14.0], [15.0, 16.0]])
}
}
ARGS = {
'struct': test_struct
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 1, dtype family float, shape (16,) — shape (16,) 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
|
| struct_mul_scalar |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("6050b70841d335c1") 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 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 jax
import jax.numpy as jnp
from jax import tree_util
# Create a simple nested structure with JAX arrays
struct = {
'layer1': jnp.array([1.0, 2.0, 3.0, 4.0]),
'layer2': {
'weights': jnp.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]),
'bias': jnp.array([0.5, 1.5])
},
'layer3': jnp.array([[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]])
}
factor = 2.5
ARGS = {
'struct': struct,
'factor': factor
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_sq |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("145eda8014bfd82a") 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 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 jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# Create a simple nested structure (pytree) containing JAX arrays
struct = {
'a': jnp.array([1.0, 2.0, 3.0, 4.0]),
'b': jnp.array([[5.0, 6.0], [7.0, 8.0]]),
'nested': {
'c': jnp.array([9.0, 10.0, 11.0]),
'd': jnp.array([12.0])
}
}
ARGS = {
'struct': struct
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_sqrt |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("ebb3869ec1266c1e") 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 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 jax.numpy as jnp
from jax import device_put, random, grad, jit, vmap, value_and_grad
from jax.tree_util import tree_flatten, tree_unflatten, tree_map
# Create a nested structure (tree) with jax arrays
struct = {
'array1': jnp.array([1.0, 4.0, 9.0, 16.0]),
'nested': {
'array2': jnp.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]),
'array3': jnp.array([0.25, 0.5, 0.75, 1.0])
},
'list_arrays': [jnp.array([4.0, 9.0]), jnp.array([16.0, 25.0])]
}
ARGS = {
'struct': struct
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| struct_sub |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("0bf286afd514640c") 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 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 jax.numpy as jnp
from jax import device_put, random, tree_util
import numpy as np
# struct_sub uses tree_map with jnp.subtract on two structures
# The structures can be nested dicts, lists, tuples of arrays
# We need two compatible nested structures
# Create simple nested structures with JAX arrays
struct_1 = {
'a': jnp.array([1.0, 2.0, 3.0, 4.0]),
'b': jnp.array([[5.0, 6.0], [7.0, 8.0]]),
'nested': {
'c': jnp.array([9.0, 10.0])
}
}
struct_2 = {
'a': jnp.array([0.1, 0.2, 0.3, 0.4]),
'b': jnp.array([[0.5, 0.6], [0.7, 0.8]]),
'nested': {
'c': jnp.array([0.9, 1.0])
}
}
ARGS = {
'struct_1': struct_1,
'struct_2': struct_2
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — 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
|
| struct_zeros_like |
Ran ran; our contract draft was wrong, not the code |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("06cd2aedfcb73bb6") 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 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 jax.numpy as jnp
from jax import tree_util
# struct_zeros_like takes a pytree structure and returns zeros_like for each leaf
# We need to construct a valid JAX pytree as the struct argument
# Create a simple pytree structure with nested arrays and dicts
struct = {
"array1": jnp.array([[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]]),
"nested": {
"array2": jnp.array([1.0, 2.0, 3.0, 4.0]),
"array3": jnp.array([[1.0, 2.0],
[3.0, 4.0],
[5.0, 6.0]])
},
"list_arrays": [jnp.array([1.0, 2.0, 3.0, 4.0]),
jnp.array([[1.0, 2.0, 3.0, 4.0]])]
}
ARGS = {
"struct": struct
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — 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
|
| BaseTrainer |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("dca6afaa2e23a3be") How it ran |
| Trainer |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("458f345611469a88") How it ran |
| imdb_loader |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("f4a878bc9479f4bc") How it ran |
| linear_model_fn |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("29b863abc869ce7a") How it ran |
| matfac_model_fn |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("32b7bb707740780e") How it ran |
| multiclass_classify |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("aeca8b544abd9191") How it ran |
| print_log |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("defe6270f77abbbd") How it ran |
| sce_loss |
Not yet run unverified (harvested, no recorded run) |
kenziyuliu/dp2/trainers/dp2_adagrad.py code served (permissive licence) · get_code("1d3f9fc33b06bb7f") How it ran |