| create_log_reg_oracle |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/oracles.py code served (permissive licence) · get_code("ce60b31344d4a637") 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 LogRegL2Oracle. 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 scipy.sparse
# Create small feature matrix A (m samples x n features)
# Using distinct dimensions: 5 samples, 3 features
m, n = 5, 3
A = np.random.randn(m, n)
# Create binary labels b (m samples,)
b = np.array([1.0, -1.0, 1.0, -1.0, 1.0])
# Regularization coefficient
regcoef = 0.1
ARGS = {
"A": A,
"b": b,
"regcoef": regcoef
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type LogRegL2Oracle — a LogRegL2Oracle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LogRegL2Oracle 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_log_sum_exp_oracle |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/oracles.py code served (permissive licence) · get_code("ad1a0bbfea706dda") 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 LogSumExpOracle. 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 scipy.sparse
# Create a small matrix A (m x n where m=5, n=3)
# The function uses A.dot(x), A.T.dot(x), and A.toarray()
m, n = 5, 3
A = np.random.randn(m, n)
# Create vector b (m x 1) to match the rows of A
b = np.random.randn(m)
# Create a scalar mu for temperature parameter
mu = 0.5
ARGS = {
'A': A,
'b': b,
'mu': mu
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type LogSumExpOracle — a LogSumExpOracle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LogSumExpOracle 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_log_sum_exp_zero_oracle |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/oracles.py code served (permissive licence) · get_code("cfded9389cb1cc10") 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 LogSumExpOracle. 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 scipy.sparse
# Set random seed for reproducibility
np.random.seed(0)
# Create a small matrix A (m x n) where m=5, n=4
# This will be used for matvec operations
m, n = 5, 4
A = np.random.randn(m, n)
# Create vector b (m,) to match the number of rows in A
b = np.random.randn(m)
# Create a small positive scalar mu for the temperature parameter
mu = 0.1
# Construct the arguments dictionary
ARGS = {
'A': A,
'b': b,
'mu': mu
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type LogSumExpOracle — a LogSumExpOracle output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LogSumExpOracle 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
|
| cubic_newton_step |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/newton_methods.py code served (permissive licence) · get_code("bcca049194949363") 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
import scipy
from scipy.linalg import LinAlgError
# Set seed for reproducibility
np.random.seed(0)
# Define dimension
n = 4
# Create a small positive definite matrix A
# Use a simple symmetric positive definite matrix
A = np.array([
[4.0, 0.5, 0.2, 0.1],
[0.5, 3.0, 0.3, 0.2],
[0.2, 0.3, 2.0, 0.1],
[0.1, 0.2, 0.1, 1.5]
], dtype=float)
# Create gradient vector g
g = np.array([1.0, -0.5, 0.3, -0.2], dtype=float)
# Create parameter H (controls the cubic term)
H = 0.5
# Create optional matrix B (identity for simplicity, but could be different)
B = np.eye(n, dtype=float)
# Create small epsilon for convergence
eps = 1e-9
ARGS = {
'g': g,
'A': A,
'H': H,
'B': B,
'eps': eps
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — 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
|
| get_labels |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/experimental_tools.py code served (permissive licence) · get_code("fa6292c3e4ccdb23") 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
class Strategy:
def __init__(self, label):
self.label = label
strategies = [
Strategy(label="strategy_a"),
Strategy(label="strategy_b"),
Strategy(label="strategy_c"),
]
ARGS = {
"strategies": strategies,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type 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
|
| get_tolerance |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/utils.py code served (permissive licence) · get_code("5a1a81a9e115a3c8") 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 Tolerance. 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)
# Test case 1: None (uses default Tolerance)
tolerance_options_none = None
# Test case 2: Tolerance object (returns as-is)
tolerance_obj = type('Tolerance', (), {})()
tolerance_obj.tolerance = 1e-08
tolerance_obj.criterion = 'grad'
tolerance_obj.relative = False
# Test case 3: Dict with 'func' criterion
tolerance_dict_func = {
'tolerance': 1e-06,
'criterion': 'func',
'f_star': 0.5,
'relative': True,
'f_0': 10.0
}
# Test case 4: Dict with 'grad' criterion
tolerance_dict_grad = {
'tolerance': 1e-05,
'criterion': 'grad',
'relative': False
}
# Test case 5: Dict with 'grad_uniform_convex' criterion
tolerance_dict_grad_uc = {
'tolerance': 1e-04,
'criterion': 'grad_uniform_convex',
'p': 2.5,
'sigma': 0.8
}
# Test case 6: Dict with 'grad_norm_bound' criterion
tolerance_dict_grad_norm_bound = {
'tolerance': 1e-03,
'criterion': 'grad_norm_bound',
'c': 0.01
}
# Test case 7: Dict with 'grad_norm_lambda_bound' criterion
tolerance_dict_grad_norm_lambda = {
'tolerance': 1e-02,
'criterion': 'grad_norm_lambda_bound',
'c': 0.25,
'lambda_bound': lambda x: np.sum(x * x) if isinstance(x, np.ndarray) else x.dot(x)
}
# Define ARGS - mapping parameter names to values
ARGS = {
'tolerance_options': tolerance_dict_grad
}
- 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 Tolerance — a Tolerance output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Tolerance 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
|
| get_tolerance_strategy |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/utils.py code served (permissive licence) · get_code("66bf6110477f1099") 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 ToleranceStrategy. 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
class ToleranceStrategy(object):
"""
Choosing the inner tolerance.
"""
def __init__(self, strategy='constant', **kwargs):
self.strategy = strategy
if strategy == 'constant':
self.delta = kwargs.get('delta', 1e-08)
self.label = kwargs.get('label', '%f' % self.delta)
elif strategy == 'power':
self.alpha = kwargs.get('alpha', 2)
self.c = kwargs.get('c', 1.0)
self.label = kwargs.get('label', '1/k^%d' % self.alpha)
elif strategy == 'adaptive':
self.alpha = kwargs.get('alpha', 1)
self.c = kwargs.get('c', 1.0)
self.label = kwargs.get('label', 'adaptive')
else:
raise ValueError('Unknown tolerance strategy {}'.format(strategy))
@classmethod
def from_dict(cls, dict):
return cls(**dict)
def to_dict(self):
return self.__dict__
def get_tolerance(self, k, f_prev, f_cur):
if self.strategy == 'constant':
return self.delta
elif self.strategy == 'power':
return self.c / (k + 1) ** self.alpha
elif self.strategy == 'adaptive':
if f_prev is None or f_prev <= f_cur + 1e-09:
return 1e-09
else:
return self.c * (f_prev - f_cur) ** self.alpha
else:
raise ValueError('Unknown tolerance strategy {}'.format(self.strategy))
def get_tolerance_strategy(tolerance_strategy_options=None):
"""
Helper to construct ToleranceStrategy.
"""
if tolerance_strategy_options:
if type(tolerance_strategy_options) is ToleranceStrategy:
return tolerance_strategy_options
else:
return ToleranceStrategy.from_dict(tolerance_strategy_options)
else:
return ToleranceStrategy()
# Test case 1: None (default behavior)
ARGS_case1 = {
'tolerance_strategy_options': None
}
# Test case 2: Dictionary with constant strategy
ARGS_case2 = {
'tolerance_strategy_options': {
'strategy': 'constant',
'delta': 1e-06,
'label': 'constant_1e-06'
}
}
# Test case 3: Dictionary with power strategy
ARGS_case3 = {
'tolerance_strategy_options': {
'strategy': 'power',
'alpha': 3,
'c': 0.5,
'label': '1/k^3'
}
}
# Test case 4: Dictionary with adaptive strategy
ARGS_case4 = {
'tolerance_strategy_options': {
'strategy': 'adaptive',
'alpha': 2,
'c': 0.1,
'label': 'adaptive_custom'
}
}
# Test case 5: ToleranceStrategy object directly
ARGS_case5 = {
'tolerance_strategy_options': ToleranceStrategy(strategy='constant', delta=1e-07)
}
ARGS = ARGS_case1
- 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 ToleranceStrategy — a ToleranceStrategy output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ToleranceStrategy 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
|
| norms_init |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/utils.py code served (permissive licence) · get_code("ebf2bf5314576eb7") 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
# Construct test arguments for norms_init function
# Case 1: B and Binv both None (identity case)
ARGS_case1 = {
'B': None,
'Binv': None
}
# Case 2: B provided, Binv computed internally
B_matrix = np.array([
[2.0, 0.5],
[0.5, 1.5]
], dtype=np.float64)
ARGS_case2 = {
'B': B_matrix,
'Binv': None
}
# Case 3: Both B and Binv provided
Binv_matrix = np.linalg.inv(B_matrix)
ARGS_case3 = {
'B': B_matrix,
'Binv': Binv_matrix
}
# Use case 2 as the main test case (B provided, Binv auto-computed)
ARGS = ARGS_case2
- 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 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
|
| run_method |
Ran ran on a synthesized input |
doikov/dynamic-accuracies/experimental_tools.py code served (permissive licence) · get_code("b1f26ae9f0525c55") 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 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 torch
import torch.nn as nn
from datetime import datetime
torch.manual_seed(0)
# Define a simple method that matches the expected signature
def simple_method(param):
"""
Expected to return a tuple of (result, status, history)
param is a dict with some configuration
"""
# Simulate some computation
history = [1.0, 2.0, 3.0]
status = "success"
result = param.get("value", 0) * 2
return result, status, history
# Define parameters - list of dicts to pass to the method
parameters = [
{"value": 1, "name": "config_a"},
{"value": 2, "name": "config_b"},
{"value": 3, "name": "config_c"},
]
# Define labels for each parameter
labels = [
"strategy_one",
"strategy_two",
"strategy_three",
]
# Construct ARGS dict with all required parameters
ARGS = {
"method": simple_method,
"parameters": parameters,
"labels": labels,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 2, 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
|