| A2C |
Ran ran on a synthesized input · constructed an object; no result was computed |
qihongl/dlstm-demo/src/model/A2C.py code served (permissive licence) · get_code("a567a3529243ae7c") 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 an instance of its own class, A2C: the run constructed the object and did not call it, so no result was computed. 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 = {
"dim_input": 4,
"dim_hidden": 8,
"dim_output": 3,
}
- 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 A2C — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a A2C 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
|
| A2CAlgo |
Ran ran on a synthesized input · constructed an object; no result was computed |
lcswillems/torch-ac/torch_ac/algos/a2c.py code served (permissive licence) · get_code("aa2085b551009e44") 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 an instance of its own class, A2CAlgo: the run constructed the object and did not call it, so no result was computed. 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
import numpy as np
import gymnasium as gym
from gymnasium import spaces
torch.manual_seed(0)
# Create a simple mock environment
class SimpleEnv(gym.Env):
def __init__(self):
self.observation_space = spaces.Box(low=0, high=255, shape=(1, 4, 4), dtype=np.uint8)
self.action_space = spaces.Discrete(3)
def reset(self, seed=None):
return np.random.randint(0, 255, size=(1, 4, 4), dtype=np.uint8), {}
def step(self, action):
obs = np.random.randint(0, 255, size=(1, 4, 4), dtype=np.uint8)
reward = float(np.random.rand())
done = False
truncated = False
return obs, reward, done, truncated, {}
# Create a mock recurrent actor-critic model
class MockACModel(nn.Module):
def __init__(self, obs_size=16, action_size=3, memory_size=8):
super().__init__()
self.obs_size = obs_size
self.action_size = action_size
self.memory_size = memory_size
self.recurrent = True
self.feat_extractor = nn.Sequential(
nn.Linear(obs_size, 16),
nn.ReLU()
)
self.gru = nn.GRUCell(16, memory_size)
self.policy_head = nn.Linear(memory_size, action_size)
self.value_head = nn.Linear(memory_size, 1)
def forward(self, obs, memory=None):
batch_size = obs.shape[0] if len(obs.shape) > 1 else 1
if memory is None:
memory = torch.zeros(batch_size, self.memory_size)
# Flatten obs if needed
if len(obs.shape) > 2:
obs_flat = obs.view(obs.shape[0], -1)
else:
obs_flat = obs
feat = self.feat_extractor(obs_flat)
new_memory = self.gru(feat, memory)
logits = self.policy_head(new_memory)
value = self.value_head(new_memory)
return logits, value, new_memory
# Mock preprocess function
def mock_preprocess_obss(obs, device='cpu'):
if isinstance(obs, list):
obs = np.stack(obs)
if isinstance(obs, np.ndarray):
obs = torch.from_numpy(obs).float()
if len(obs.shape) == 4:
obs = obs.view(obs.shape[0], -1)
else:
obs = obs.view(-1)
return obs.to(device)
# Mock reshape reward function
def mock_reshape_reward(obs, action, reward, done):
return reward
# Mock ParallelEnv class
class ParallelEnv:
def __init__(self, envs):
self.envs = envs
self.num_envs = len(envs)
def reset(self):
obs_list = []
for env in self.envs:
obs, _ = env.reset()
obs_list.append(obs)
return obs_list
def step(self, actions):
obs_list = []
rewards = []
dones = []
infos = []
for i, env in enumerate(self.envs):
obs, reward, done, truncated, info = env.step(int(actions[i]))
obs_list.append(obs)
rewards.append(reward)
dones.append(done or truncated)
infos.append(info)
return obs_list, np.array(rewards), np.array(dones), infos
# Create small test environments
envs = [SimpleEnv() for _ in range(2)]
# Create model
acmodel = MockACModel(obs_size=16, action_size=3, memory_size=8)
# Build arguments
ARGS = {
'envs': envs,
'acmodel': acmodel,
'device': torch.device('cpu'),
'num_frames_per_proc': 4,
'discount': 0.99,
'lr': 0.001,
'gae_lambda': 0.95,
'entropy_coef': 0.01,
'value_loss_coef': 0.5,
'max_grad_norm': 0.5,
'recurrence': 1,
'preprocess_obss': mock_preprocess_obss,
'reshape_reward': mock_reshape_reward
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gymnasium, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type A2CAlgo — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a A2CAlgo 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
|
| A2C_discrete |
Ran ran on a synthesized input · constructed an object; no result was computed |
qihongl/demo-advantage-actor-critic/src/models/_A2C_discrete.py code served (permissive licence) · get_code("36ac405a267ff486") 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 an instance of its own class, A2C_discrete: the run constructed the object and did not call it, so no result was computed. 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 = {
'dim_input': 4,
'dim_hidden': 8,
'dim_output': 3
}
- 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 A2C_discrete — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a A2C_discrete 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
|
| A3C |
Ran ran on a synthesized input · constructed an object; no result was computed |
dsinghnegi/atari_RL_agent/models/a3c.py code served (permissive licence) · get_code("d13a62401d06ac43") 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 an instance of its own class, A3C: the run constructed the object and did not call it, so no result was computed. 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
import numpy as np
torch.manual_seed(0)
ARGS = {
"n_actions": 6,
"hidden": 256,
"lstm": True,
}
- 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 A3C — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a A3C 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
|
| ACNet |
Ran ran on a synthesized input · constructed an object; no result was computed |
tensorlayer/RLzoo/rlzoo/algorithms/a3c/a3c.py code served (permissive licence) · get_code("eebbc364319ac1a0") 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 an instance of its own class, ACNet: the run constructed the object and did not call it, so no result was computed. 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
class PolicyDistribution:
"""Mock policy distribution with required methods"""
def __init__(self):
self._logp_value = tf.Variable(0.0, trainable=False)
self._entropy_value = tf.Variable(0.1, trainable=False)
def logp(self, actions):
# Return log probability matching action batch size
batch_size = tf.shape(actions)[0]
return tf.fill([batch_size], -0.5)
def entropy(self):
# Return entropy value
return tf.constant(0.1)
class MockActor(tf.Module):
"""Mock actor network with policy_dist attribute"""
def __init__(self):
super().__init__()
self.dense = tf.keras.layers.Dense(4, activation='relu')
self.policy_dist = PolicyDistribution()
self.trainable_weights = [
tf.Variable(np.random.randn(4, 4).astype(np.float32)),
tf.Variable(np.random.randn(4).astype(np.float32))
]
def __call__(self, inputs, greedy=False):
batch_size = tf.shape(inputs)[0]
# Return action tensor of shape [batch_size]
return tf.random.normal([batch_size])
class MockCritic(tf.Module):
"""Mock critic network"""
def __init__(self):
super().__init__()
self.dense = tf.keras.layers.Dense(1, activation=None)
self.trainable_weights = [
tf.Variable(np.random.randn(4, 1).astype(np.float32)),
tf.Variable(np.random.randn(1).astype(np.float32))
]
def __call__(self, inputs):
batch_size = tf.shape(inputs)[0]
# Return value tensor of shape [batch_size, 1]
return tf.random.normal([batch_size, 1])
# Create mock optimizer globals
OPT_C = tf.keras.optimizers.Adam(learning_rate=0.001)
OPT_A = tf.keras.optimizers.Adam(learning_rate=0.001)
# Inject into module namespace so update_global can access them
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'OPT_C', OPT_C)
setattr(current_module, 'OPT_A', OPT_A)
# Create minimal test data
batch_size = 2
state_dim = 4
buffer_s = tf.constant(np.random.randn(batch_size, state_dim).astype(np.float32))
buffer_a = tf.constant(np.random.randn(batch_size).astype(np.float32))
buffer_v_target = tf.constant(np.random.randn(batch_size, 1).astype(np.float32))
# Create actor and critic
actor = MockActor()
critic = MockCritic()
ARGS = {
'net_list': [actor, critic],
'scope': 'test_scope',
'entropy_beta': 0.01
}
- 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 ACNet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ACNet 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
|
| Actor |
Ran ran on a synthesized input |
Remtasya/DDPG-Actor-Critic-Reinforcement-Learning-Reacher-Environment/ddpg_agent.py pointer only (licence: NONE) · get_code("a83ecbc1e78102e4") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, Remtasya/DDPG-Actor-Critic-Reinforcement-Learning-Reacher-Environment when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| Actor |
Ran ran on a synthesized input |
bentrevett/pytorch-rl/n_step_a2c.py code served (permissive licence) · get_code("75bd98e327fba9f3") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 3) 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.nn.functional import log_softmax, softmax, mse_loss, normalize
class Actor(nn.Module):
def __init__(self, observation_space_size: int, action_space_size: int, hidden_size: int):
super(Actor, self).__init__()
self.net = nn.Sequential(nn.Linear(in_features=observation_space_size, out_features=hidden_size, bias=True), nn.PReLU(), nn.Linear(in_features=hidden_size, out_features=hidden_size, bias=True), nn.PReLU(), nn.Linear(in_features=hidden_size, out_features=action_space_size, bias=True))
def forward(self, x):
x = normalize(x, dim=1)
x = self.net(x)
return x
INIT_ARGS = {
'observation_space_size': 4,
'action_space_size': 3,
'hidden_size': 8,
}
ARGS = {
'x': torch.randn(2, 4),
}
if __name__ == '__main__':
actor = Actor(**INIT_ARGS)
output = actor(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {output}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ActorCritic |
Ran ran on a synthesized input · constructed an object; no result was computed |
uvipen/Super-mario-bros-A3C-pytorch/src/model.py code served (permissive licence) · get_code("3deab9eb1f3ddf5a") 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 an instance of its own class, ActorCritic: the run constructed the object and did not call it, so no result was computed. 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)
# The forward method expects:
# - x: input tensor that goes through 4 Conv2d layers with specific stride/padding
# After 4 stride-2 convolutions, a spatial size of 96x96 becomes 6x6
# So we need input of shape (batch, num_inputs, height, width)
# Let's use batch=2, num_inputs=3, height=96, width=96
# - hx: hidden state for LSTMCell, shape (batch, 512)
# - cx: cell state for LSTMCell, shape (batch, 512)
num_inputs = 3
num_actions = 5
batch_size = 2
# Create input tensor: (batch, channels, height, width)
# After 4 conv layers with stride=2, 96x96 -> 48x48 -> 24x24 -> 12x12 -> 6x6
x = torch.randn(batch_size, num_inputs, 96, 96)
# Create LSTM hidden and cell states: (batch, hidden_size)
hx = torch.randn(batch_size, 512)
cx = torch.randn(batch_size, 512)
ARGS = {
'num_inputs': num_inputs,
'num_actions': num_actions,
}
- 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 ActorCritic — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ActorCritic 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
|
| ActorCritic |
Ran ran on a synthesized input · constructed an object; no result was computed |
Kaixhin/ACER/model.py code served (permissive licence) · get_code("1980413ab36cb308") 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 an instance of its own class, ActorCritic: the run constructed the object and did not call it, so no result was computed. 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
from torch import Tensor
torch.manual_seed(0)
# Create a stand-in observation space
class ObservationSpace:
def __init__(self, shape):
self.shape = shape
# Create a stand-in action space
class ActionSpace:
def __init__(self, n):
self.n = n
# Define the arguments
observation_space = ObservationSpace(shape=(4,))
action_space = ActionSpace(n=3)
hidden_size = 5
ARGS = {
"observation_space": observation_space,
"action_space": action_space,
"hidden_size": hidden_size,
}
- 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 ActorCritic — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ActorCritic 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
|
| ActorCritic |
Ran ran on a synthesized input · constructed an object; no result was computed |
sharan-dce/A3C/network.py pointer only (licence: NONE) · get_code("fc9bb6ed16967be3") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, sharan-dce/A3C when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| ActorCritic |
Ran ran on a synthesized input · constructed an object; no result was computed |
Kaixhin/NoisyNet-A3C/model.py code served (permissive licence) · get_code("3ce452dd0eac4e57") 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 an instance of its own class, ActorCritic: the run constructed the object and did not call it, so no result was computed. 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
from torch.nn import init
import math
torch.manual_seed(0)
# Create mock observation and action spaces
class MockObservationSpace:
def __init__(self, state_size):
self.shape = (state_size,)
class MockActionSpace:
def __init__(self, num_actions):
self.n = num_actions
# Define the arguments
observation_space = MockObservationSpace(state_size=4)
action_space = MockActionSpace(num_actions=3)
hidden_size = 8
sigma_init = 0.017
no_noise = False
ARGS = {
"observation_space": observation_space,
"action_space": action_space,
"hidden_size": hidden_size,
"sigma_init": sigma_init,
"no_noise": no_noise,
}
- 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 ActorCritic — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ActorCritic 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
|
| ActorCritic |
Ran ran on a synthesized input |
sainijagjit/A3C-Pytorch/model.py pointer only (licence: NONE) · get_code("6dc67ce074d20f64") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, sainijagjit/A3C-Pytorch when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| Agent |
Ran ran on a synthesized input · constructed an object; no result was computed |
Nasdin/ReinforcementLearning-AtariGame/reinforcement_learninga3c/agent.py code served (permissive licence) · get_code("470157876533fcf9") 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 an instance of its own class, Agent: the run constructed the object and did not call it, so no result was computed. 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 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 dataclasses import dataclass
torch.manual_seed(0)
# Define the A3Clstm model
class A3Clstm(nn.Module):
def __init__(self, input_channels: int, action_space: int):
super(A3Clstm, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(input_channels, 16, kernel_size=8, stride=4),
nn.ReLU(),
nn.Conv2d(16, 32, kernel_size=4, stride=2),
nn.ReLU()
)
self.lstm = nn.LSTMCell(32 * 9 * 9, 512)
self.actor = nn.Linear(512, action_space)
self.critic = nn.Linear(512, 1)
def forward(self, x, hidden):
x = x.to(next(self.parameters()).device)
x = self.conv(x)
x = torch.flatten(x, start_dim=1)
hx, cx = hidden
hx, cx = self.lstm(x, (hx, cx))
value = self.critic(hx)
logit = self.actor(hx)
return (value, logit, (hx, cx))
# Define Args dataclass
@dataclass
class Args:
environment: str
config: str
log_dir: str
load_model: bool
load_model_dir: str
save_model_dir: str
seed: int
max_episode_length: int
num_steps: int
num_workers: int
learning_rate: float
gamma: float
tau: float
shared_optimizer: bool
save_score_level: int
check_lives: bool
env_config: str
# Create a mock environment
class MockEnv:
def __init__(self):
self.action_space_n = 4
def reset(self):
# Return a tensor of shape (1, 84, 84) to match expected input
return torch.zeros(1, 84, 84, dtype=torch.float32)
def step(self, action):
# Return (state, reward, done, info)
state = torch.zeros(1, 84, 84, dtype=torch.float32)
reward = 0.5
done = False
info = {}
return state, reward, done, info
# Create model with 1 input channel and 4 actions
model = A3Clstm(input_channels=1, action_space=4)
# Create mock environment
env = MockEnv()
# Create Args
args = Args(
environment="Pong-v0",
config="",
log_dir="/tmp",
load_model=False,
load_model_dir="",
save_model_dir="",
seed=42,
max_episode_length=500,
num_steps=100,
num_workers=4,
learning_rate=0.001,
gamma=0.99,
tau=1.0,
shared_optimizer=True,
save_score_level=100,
check_lives=False,
env_config="settings.json"
)
# Create ARGS dict
ARGS = {
"model": model,
"env": env,
"args": args
}
- 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 Agent — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Agent 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
|
| Args |
Ran ran on a synthesized input · constructed an object; no result was computed |
Nasdin/ReinforcementLearning-AtariGame/reinforcement_learninga3c/agent.py code served (permissive licence) · get_code("889702214bbc32be") 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 an instance of its own class, Args: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass
@dataclass
class Args:
environment: str
config: str
log_dir: str
load_model: bool
load_model_dir: str
save_model_dir: str
seed: int
max_episode_length: int
num_steps: int
num_workers: int
learning_rate: float
gamma: float
tau: float
shared_optimizer: bool
save_score_level: int
check_lives: bool
env_config: str
@classmethod
def from_dict(cls, args_dict: dict) -> 'Args':
return cls(environment=args_dict.get('environment', ''), config=args_dict.get('config', ''), log_dir=args_dict.get('log_dir', ''), load_model=args_dict.get('load_model', False), load_model_dir=args_dict.get('load_model_dir', ''), save_model_dir=args_dict.get('save_model_dir', ''), seed=args_dict.get('seed', 0), max_episode_length=args_dict.get('max_episode_length', 0), num_steps=args_dict.get('num_steps', 0), num_workers=args_dict.get('num_workers', 0), learning_rate=args_dict.get('learning_rate', 0.0), gamma=args_dict.get('gamma', 0.0), tau=args_dict.get('tau', 0.0), shared_optimizer=args_dict.get('shared_optimizer', False), save_score_level=args_dict.get('save_score_level', 0), check_lives=args_dict.get('check_lives', False), env_config=args_dict.get('env_config', 'settings.json'))
ARGS = {
'environment': 'CartPole-v1',
'config': 'default_config',
'log_dir': '/tmp/logs',
'load_model': False,
'load_model_dir': '/tmp/models/load',
'save_model_dir': '/tmp/models/save',
'seed': 42,
'max_episode_length': 500,
'num_steps': 10000,
'num_workers': 4,
'learning_rate': 0.001,
'gamma': 0.99,
'tau': 0.95,
'shared_optimizer': True,
'save_score_level': 100,
'check_lives': True,
'env_config': 'settings.json'
}
- 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 Args — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Args 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
|
| AtariCnnAcLstm |
Ran ran on a synthesized input · constructed an object; no result was computed |
liuyuezhang/pyrl/a3c/model.py code served (permissive licence) · get_code("c714c593caa9bd29") 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 an instance of its own class, AtariCnnAcLstm: the run constructed the object and did not call it, so no result was computed. 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)
# The model expects:
# - num_inputs: number of input channels (Atari observations typically grayscale or stacked frames)
# - num_actions: number of possible actions
# - debug: boolean flag for debug mode
# We need to construct inputs for forward():
# - ob: observation tensor of shape (batch_size, num_inputs, height, width)
# - hist: tuple of (hx, cx) where hx and cx are LSTM hidden/cell states
# Working backwards from the conv layers:
# conv1: Conv2d(num_inputs, 32, kernel=8, stride=4)
# conv2: Conv2d(32, 64, kernel=4, stride=2)
# conv3: Conv2d(64, 64, kernel=3, stride=1)
# After conv3, the output is flattened to 3136 features for the LSTM
# Let's compute the required input spatial dimensions:
# After conv3: (H - 3) / 1 + 1 = H - 2
# After conv2: ((H - 2 - 4) / 2 + 1) = (H - 6) / 2 + 1
# After conv1: (((H - 6) / 2 + 1 - 8) / 4 + 1)
# We need the final flattened size to be 3136 = 64 * H' * W'
# For simplicity, let's use 84x84 (standard Atari size)
# After conv1 (k=8, s=4): (84 - 8) / 4 + 1 = 20
# After conv2 (k=4, s=2): (20 - 4) / 2 + 1 = 9
# After conv3 (k=3, s=1): (9 - 3) / 1 + 1 = 7
# Output channels: 64, so flattened = 64 * 7 * 7 = 3136 ✓
batch_size = 2
num_inputs = 4 # e.g., 4 stacked frames
num_actions = 18 # typical Atari
height = 84
width = 84
lstm_hidden_size = 512
# Create observation tensor
ob = torch.randn(batch_size, num_inputs, height, width)
# Create LSTM hidden and cell states
hx = torch.randn(batch_size, lstm_hidden_size)
cx = torch.randn(batch_size, lstm_hidden_size)
hist = (hx, cx)
ARGS = {
"num_inputs": num_inputs,
"num_actions": num_actions,
"debug": False,
}
- 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 AtariCnnAcLstm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AtariCnnAcLstm 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
|
| AtariRescale42x42 |
Ran ran on a synthesized input · constructed an object; no result was computed |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("90d3031d1f7b8447") 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 an instance of its own class, AtariRescale42x42: the run constructed the object and did not call it, so no result was computed. 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 gym
from gym.spaces import Box
# Create a minimal stand-in Atari environment
class MinimalAtariEnv(gym.Env):
def __init__(self):
self.observation_space = Box(0, 255, shape=(210, 160, 3), dtype=np.uint8)
self.action_space = gym.spaces.Discrete(4)
def reset(self):
# Return a frame with shape (210, 160, 3) - typical Atari frame
return np.random.randint(0, 256, size=(210, 160, 3), dtype=np.uint8)
def step(self, action):
observation = np.random.randint(0, 256, size=(210, 160, 3), dtype=np.uint8)
reward = 0.0
done = False
info = {}
return observation, reward, done, info
def render(self, mode='human'):
pass
# Create the minimal environment to pass to AtariRescale42x42
env = MinimalAtariEnv()
ARGS = {
'env': env
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, gym, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type AtariRescale42x42 — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AtariRescale42x42 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
|
| DeepQNetwork |
Ran ran on a synthesized input |
brett-daley/fast-dqn/fast_dqn/worker.py code served (permissive licence) · get_code("009b3dfa7483e56f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned NoneType. 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
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Conv2D, Dense, Flatten, InputLayer
import numpy as np
def huber_loss(x):
return tf.where(tf.abs(x) <= 1.0, 0.5 * tf.square(x), tf.abs(x) - 0.5)
class DeepQNetwork:
def __init__(self, env, optimizer, discount):
self.optimizer = optimizer
self.discount = discount
def model():
return Sequential([InputLayer(env.observation_space.shape), Conv2D(32, kernel_size=8, strides=4, activation='relu'), Conv2D(64, kernel_size=4, strides=2, activation='relu'), Conv2D(64, kernel_size=3, strides=1, activation='relu'), Flatten(), Dense(512, activation='relu'), Dense(env.action_space.n)])
self._main_net = model()
self._target_net = model()
self._main_vars = self._main_net.trainable_variables
self._target_vars = self._target_net.trainable_variables
def _preprocess_states(self, states):
return tf.cast(states, tf.float32) / 255.0
@tf.function
def predict(self, states):
return self._main_net(self._preprocess_states(states))
@tf.function
def predict_target(self, states):
return self._target_net(self._preprocess_states(states))
@tf.function
def train(self, states, actions, rewards, next_states, dones):
next_Q = self.predict_target(next_states)
done_mask = 1.0 - tf.cast(dones, tf.float32)
targets = rewards + self.discount * done_mask * tf.reduce_max(next_Q, axis=1)
action_mask = tf.one_hot(actions, depth=next_Q.shape[1])
with tf.GradientTape() as tape:
Q = self.predict(states)
Q = tf.reduce_sum(action_mask * Q, axis=1)
loss = tf.reduce_mean(huber_loss(targets - Q))
gradients = tape.gradient(loss, self._main_vars)
self.optimizer.apply_gradients(zip(gradients, self._main_vars))
@tf.function
def update_target_net(self):
for var, target in zip(self._main_vars, self._target_vars):
target.assign(var)
class MockObservationSpace:
def __init__(self, shape):
self.shape = shape
class MockActionSpace:
def __init__(self, n):
self.n = n
class MockEnv:
def __init__(self):
self.observation_space = MockObservationSpace((84, 84, 4))
self.action_space = MockActionSpace(4)
INIT_ARGS = {
'env': MockEnv(),
'optimizer': tf.keras.optimizers.Adam(learning_rate=0.001),
'discount': 0.99
}
ARGS = {
'states': tf.constant(np.random.randint(0, 256, (2, 84, 84, 4), dtype=np.uint8)),
'actions': tf.constant([0, 1], dtype=tf.int32),
'rewards': tf.constant([1.0, -0.5], dtype=tf.float32),
'next_states': tf.constant(np.random.randint(0, 256, (2, 84, 84, 4), dtype=np.uint8)),
'dones': tf.constant([False, True], dtype=tf.bool)
}
METHOD = 'train'
if __name__ == '__main__':
dqn = DeepQNetwork(**INIT_ARGS)
dqn.train(**ARGS)
print("DeepQNetwork training executed successfully")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| DescriptionWrapper |
Ran ran on a synthesized input · constructed an object; no result was computed |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("69bf1d6389bcaf03") 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 an instance of its own class, DescriptionWrapper: the run constructed the object and did not call it, so no result was computed. 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 gym
import torch
torch.manual_seed(0)
# Create a simple test environment
env = gym.make('CartPole-v1')
# Create a stand-in class for changeable_parameters with required attributes
class ParameterDescriptor:
def __init__(self, name):
self.name = name
# Define changeable parameters list
changeable_parameters = [
ParameterDescriptor('gravity'),
ParameterDescriptor('masscart'),
]
# Add attributes to the unwrapped env that match the parameter names
env.unwrapped.gravity = 9.8
env.unwrapped.masscart = 1.0
# Prepare kwargs for the wrapper
kwargs_dict = {
'param1': 'value1',
'param2': 42,
}
ARGS = {
'env': env,
**kwargs_dict
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gym, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type DescriptionWrapper — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DescriptionWrapper 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
|
| Environment |
Ran ran on a synthesized input · constructed an object; no result was computed |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("25ded467bd14aa3e") 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 an instance of its own class, Environment: the run constructed the object and did not call it, so no result was computed. 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 gym
import torch
torch.manual_seed(0)
# Create a minimal gym environment to wrap
base_env = gym.make('CartPole-v1')
# The Environment class inherits from DescriptionWrapper which inherits from gym.Wrapper
# The __init__ method takes:
# - env: a gym environment
# - **kwargs: additional keyword arguments
# Construct the arguments
ARGS = {
'env': base_env,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gym, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Environment — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Environment 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
|
| ExperiencesMemory |
Ran ran on a synthesized input · constructed an object; no result was computed |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("a630d91f51a42729") 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 an instance of its own class, ExperiencesMemory: the run constructed the object and did not call it, so no result was computed. 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)
# Define the Experience namedtuple
from collections import namedtuple
Experience = namedtuple('Experience', ['state', 'action', 'reward', 'next_state', 'value', 'features', 'terminal'])
# Define the ExperiencesMemory class
class ExperiencesMemory(object):
"""Experience gathered from an environment."""
def __init__(self):
super().__init__()
self.experiences = []
self.steps = 0
def add(self, state, action, reward, value=None, features=None, terminal=False, next_state=None):
"""Add a single transition to the trajectory."""
exp = Experience(state, action, reward, next_state, value, features, terminal)
self.experiences.append(exp)
self.steps += 1
def extend(self, other):
"""
Extend a trajectory with another one.
"""
self.experiences.extend(other.experiences)
self.steps += other.steps
@property
def states(self):
return [exp.state for exp in self.experiences]
@property
def actions(self):
return [exp.action for exp in self.experiences]
@property
def rewards(self):
return [exp.reward for exp in self.experiences]
@property
def values(self):
return [exp.value for exp in self.experiences]
@property
def features(self):
return [exp.features for exp in self.experiences]
@property
def terminal(self):
"""Last experience is terminal."""
return self.experiences[-1].terminal
@property
def terminals(self):
return [exp.terminal for exp in self.experiences]
@property
def next_states(self):
return [exp.next_state for exp in self.experiences]
def __getitem__(self, i):
return self.experiences[i]
# Create a memory instance and populate it with sample data
memory = ExperiencesMemory()
# Add some sample experiences
state_1 = torch.randn(4)
action_1 = 0
reward_1 = 1.0
value_1 = 0.5
features_1 = torch.randn(3)
next_state_1 = torch.randn(4)
memory.add(state_1, action_1, reward_1, value=value_1, features=features_1, terminal=False, next_state=next_state_1)
state_2 = torch.randn(4)
action_2 = 1
reward_2 = 2.0
value_2 = 0.7
features_2 = torch.randn(3)
next_state_2 = torch.randn(4)
memory.add(state_2, action_2, reward_2, value=value_2, features=features_2, terminal=True, next_state=next_state_2)
ARGS = {}
- 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 ExperiencesMemory — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ExperiencesMemory 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
|
| NoisyLinear |
Ran ran on a synthesized input · constructed an object; no result was computed |
Kaixhin/NoisyNet-A3C/model.py code served (permissive licence) · get_code("d56ce68005b7b2e2") 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 an instance of its own class, NoisyLinear: the run constructed the object and did not call it, so no result was computed. 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 math
import torch
from torch import nn
from torch.nn import init, Parameter
from torch.nn import functional as F
from torch.autograd import Variable
torch.manual_seed(0)
# NoisyLinear expects:
# - in_features: int
# - out_features: int
# - sigma_init: float (optional, default=0.017)
# - bias: bool (optional, default=True)
ARGS = {
'in_features': 4,
'out_features': 3,
'sigma_init': 0.017,
'bias': True
}
- 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 NoisyLinear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a NoisyLinear 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
|
| OUNoise |
Ran ran on a synthesized input |
Remtasya/DDPG-Actor-Critic-Reinforcement-Learning-Reacher-Environment/ddpg_agent.py pointer only (licence: NONE) · get_code("1f98ee39e6a11d66") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, Remtasya/DDPG-Actor-Critic-Reinforcement-Learning-Reacher-Environment when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| ReplayMemory |
Ran ran on a synthesized input · constructed an object; no result was computed |
brett-daley/fast-dqn/fast_dqn/worker.py code served (permissive licence) · get_code("6b7e1cbca8de3a03") 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 an instance of its own class, ReplayMemory: the run constructed the object and did not call it, so no result was computed. 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 gym import spaces
class MockEnv:
def __init__(self):
self.action_space = spaces.Discrete(4)
self.action_space.dtype = np.int64
env = MockEnv()
capacity = 100
seed = 42
ARGS = {
"env": env,
"capacity": capacity,
"seed": seed,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gym, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ReplayMemory — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ReplayMemory 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
|
| RunnerThread |
Ran ran on a synthesized input · constructed an object; no result was computed |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("da9e5c9b8fface01") 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 an instance of its own class, RunnerThread: the run constructed the object and did not call it, so no result was computed. 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 gym
import numpy as np
import tensorflow as tf
from collections import namedtuple
# Define the Experience namedtuple and ExperiencesMemory class (from the function)
Experience = namedtuple('Experience', ['state', 'action', 'reward', 'next_state', 'value', 'features', 'terminal'])
class ExperiencesMemory(object):
"""Experience gathered from an environment."""
def __init__(self):
super().__init__()
self.experiences = []
self.steps = 0
def add(self, state, action, reward, value=None, features=None, terminal=False, next_state=None):
"""Add a single transition to the trajectory."""
exp = Experience(state, action, reward, next_state, value, features, terminal)
self.experiences.append(exp)
self.steps += 1
def extend(self, other):
"""
Extend a trajectory with another one.
"""
self.experiences.extend(other.experiences)
self.steps += other.steps
@property
def states(self):
return [exp.state for exp in self.experiences]
@property
def actions(self):
return [exp.action for exp in self.experiences]
@property
def rewards(self):
return [exp.reward for exp in self.experiences]
@property
def values(self):
return [exp.value for exp in self.experiences]
@property
def features(self):
return [exp.features for exp in self.experiences]
@property
def terminal(self):
"""Last experience is terminal."""
return self.experiences[-1].terminal
@property
def terminals(self):
return [exp.terminal for exp in self.experiences]
@property
def next_states(self):
return [exp.next_state for exp in self.experiences]
def __getitem__(self, i):
return self.experiences[i]
# Create a minimal Policy class that satisfies the interface
class MinimalPolicy:
def __init__(self):
self.initial_features = np.array([0.1, 0.2])
def choose_action(self, state, features):
return {
'action': 0,
'value': 1.0,
'features': np.array([0.1, 0.2])
}
def get_env_action(self, action):
return action
# Create a minimal environment that satisfies the interface
class MinimalEnv:
def __init__(self):
self.spec = type('obj', (object,), {'tags': {}})()
self.metadata = {'semantics.autoreset': True}
self._step_count = 0
def reset(self):
self._step_count = 0
return np.array([0.1, 0.2, 0.3, 0.4])
def step(self, action):
self._step_count += 1
# state, reward, terminal, info
next_state = np.array([0.1, 0.2, 0.3, 0.4])
reward = 1.0
terminal = self._step_count >= 3 # Episode ends after 3 steps
info = {}
return next_state, reward, terminal, info
def render(self):
pass
ARGS = {
'env': MinimalEnv(),
'policy': MinimalPolicy(),
'n_local_steps': 2,
'render': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gym, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type RunnerThread — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RunnerThread 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
|
| Worker |
Ran ran on a synthesized input · constructed an object; no result was computed |
tensorlayer/RLzoo/rlzoo/algorithms/a3c/a3c.py code served (permissive licence) · get_code("b9bee97fd591c0ca") 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 an instance of its own class, Worker: the run constructed the object and did not call it, so no result was computed. 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
from unittest.mock import Mock, MagicMock
import gym
# Create mock environment
mock_env = Mock()
mock_env.spec.id = "CartPole-v1"
mock_env.reset.return_value = np.array([0.1, 0.2, 0.3, 0.4], dtype='float32')
mock_env.step.return_value = (
np.array([0.15, 0.25, 0.35, 0.45], dtype='float32'),
1.0,
False,
{}
)
mock_env.render.return_value = None
# Create mock actor network with policy_dist
mock_actor = Mock()
mock_actor.trainable_weights = [tf.Variable(tf.ones((4, 8))), tf.Variable(tf.ones((8,)))]
mock_policy_dist = Mock()
mock_policy_dist.logp = Mock(return_value=tf.constant([-0.5, -0.6]))
mock_policy_dist.entropy = Mock(return_value=tf.constant([0.1, 0.15]))
mock_actor.policy_dist = mock_policy_dist
mock_actor.return_value = tf.constant([[0.2, 0.3], [0.4, 0.5]])
def mock_actor_call(x, greedy=False):
return tf.constant([[0.2, 0.3], [0.4, 0.5]])
mock_actor.__call__ = mock_actor_call
# Create mock critic network
mock_critic = Mock()
mock_critic.trainable_weights = [tf.Variable(tf.ones((4, 8))), tf.Variable(tf.ones((8, 1)))]
mock_critic.return_value = tf.constant([[0.5], [0.6]])
def mock_critic_call(x):
return tf.constant([[0.5], [0.6]])
mock_critic.__call__ = mock_critic_call
# Global variables that the Worker.work() method expects
COORD = Mock()
COORD.should_stop = Mock(return_value=False)
GLOBAL_RUNNING_R = []
GLOBAL_EP = 0
OPT_A = tf.keras.optimizers.Adam(learning_rate=0.001)
OPT_C = tf.keras.optimizers.Adam(learning_rate=0.001)
t0 = 0.0
SAVE_INTERVAL = 100
# Mock functions that save/load/plot
def save_model(model, name, algo, env_name):
pass
def load_model(model, name, algo, env_name):
pass
def plot_save_log(rewards, algorithm_name, env_name):
pass
ARGS = {
'env': mock_env,
'net_list': [mock_actor, mock_critic],
'name': 'Worker_0',
'train_episodes': 2,
'max_steps': 5,
'gamma': 0.99,
'update_itr': 2,
'entropy_beta': 0.01,
'render': False,
'plot_func': lambda x: None
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- gym, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Worker — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Worker 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
|
| _process_frame42 |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("29ba166ead384f3c") 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 3, dtype family float, shape (42, 42, 1) 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
# Create a sample frame with shape (210, 160, 3) - a typical Atari game frame
# The function crops [34:34+160, :160] so we need at least 194 rows and 160 cols
frame = np.random.randint(0, 256, size=(210, 160, 3), dtype=np.uint8)
ARGS = {
"frame": frame
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family float, shape (42, 42, 1) — shape (42, 42, 1) 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
|
| _sample_action |
Ran ran; our contract draft was wrong, not the code |
qihongl/demo-advantage-actor-critic/src/models/_A2C_discrete.py code served (permissive licence) · get_code("f76bd426a9b5e661") 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
from torch.distributions import Categorical
torch.manual_seed(0)
# The function takes pi_a_t, which is a 1d torch.tensor representing an action distribution
# It must be a valid probability distribution (non-negative values that sum to 1)
# The Categorical distribution will sample from it
pi_a_t = torch.tensor([0.1, 0.2, 0.3, 0.4]) # 4 actions with valid probabilities
ARGS = {
"pi_a_t": pi_a_t
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, 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
|
| check_error |
Ran ran on a synthesized input |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/remote_controller.py code served (permissive licence) · get_code("aed449e344ec7692") 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 Mock. 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
from unittest.mock import Mock
torch.manual_seed(0)
# Create a mock response object with HasField method and error field
res = Mock()
# Case 1: No error - HasField returns False
res.HasField = Mock(return_value=False)
# Create a mock error_enum
error_enum = Mock()
error_enum.DESCRIPTOR = Mock()
error_enum.DESCRIPTOR.full_name = "test.error.ErrorType"
error_enum.Name = Mock(return_value="NO_ERROR")
ARGS = {
'res': res,
'error_enum': error_enum
}
- 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 Mock — a Mock 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
|
| choose_action |
Ran ran on a synthesized input |
miyosuda/async_deep_reinforce/a3c_display.py code served (permissive licence) · get_code("21cd096f7f260710") 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
# Set seed for reproducibility
np.random.seed(42)
# Create valid probability distribution (sums to 1, all non-negative)
pi_values = np.array([0.2, 0.3, 0.3, 0.2])
ARGS = {
"pi_values": pi_values
}
- 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 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
|
| circle_mask |
Ran ran on a synthesized input |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/renderer_human.py code served (permissive licence) · get_code("4c5d083e16a65872") 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 (8, 10) 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
class Point:
def __init__(self, x, y):
self.x = x
self.y = y
class Shape:
def __init__(self, x, y):
self.x = x
self.y = y
ARGS = {
"shape": Shape(x=10, y=8),
"pt": Point(x=3, y=2),
"radius": 4
}
- 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 ndarray, ndim 2, dtype family float, shape (8, 10) — shape (8, 10) 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
|
| clamp |
Ran ran, honoured the contract we drafted |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/renderer_human.py pointer only (licence: MIT); the stored copy get_code serves, from inkitori/taudio, is pointer only (licence: NONE) · get_code("768c86dee853b804") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from inkitori/taudio, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| cluster_spec |
Ran ran on a synthesized input |
openai/universe-starter-agent/worker.py pointer only (licence: MIT); the stored copy get_code serves, from braemt/attentive-multi-task-deep-reinforcement-learning, is pointer only (licence: MIT) · get_code("efb159661f0b9fcf") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from braemt/attentive-multi-task-deep-reinforcement-learning, and MIT, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| conv_block |
Ran ran on a synthesized input |
gungui98/deeprl-a3c-ai2thor/utils/networks.py code served (permissive licence) · get_code("ee54b4f2b5bd8b07") 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 KerasTensor. 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
from tensorflow import keras
from tensorflow.keras.layers import Input
# Set seed for reproducibility
torch.manual_seed(0)
# Create a small input tensor for the conv_block
# Input shape: (batch_size, height, width, channels)
# Using batch=2, height=4, width=3, channels=5 for distinctness
input_data = np.random.randn(2, 4, 3, 5).astype(np.float32)
# Create a Keras Input layer that will be passed as inp parameter
inp = Input(shape=(4, 3, 5))
ARGS = {
'inp': inp,
'd': 3,
'pool_size': (2, 2),
'k': 3
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- keras, numpy, tensorflow, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type KerasTensor — a KerasTensor 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
|
| conv_layer |
Ran ran on a synthesized input |
gungui98/deeprl-a3c-ai2thor/utils/networks.py code served (permissive licence) · get_code("da3dae2a4156eb66") 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 Conv2D. 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
from keras.layers import Conv2D, MaxPooling2D
torch.manual_seed(0)
# The function conv_layer takes two parameters:
# d: number of filters (depth)
# k: kernel size
ARGS = {
'd': 32,
'k': 3
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- keras, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Conv2D — a Conv2D output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2D 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
|
| decorate_check_error |
Ran ran on a synthesized input |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/remote_controller.py code served (permissive licence) · get_code("bcc7bff6de339758") 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 function. 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 functools
from unittest.mock import Mock
class RequestError(Exception):
def __init__(self, description, res):
super(RequestError, self).__init__(description)
self.res = res
def check_error(res, error_enum):
"""Raise if the result has an error, otherwise return the result."""
if res.HasField('error'):
enum_name = error_enum.DESCRIPTOR.full_name
error_name = error_enum.Name(res.error)
details = getattr(res, 'error_details', '<none>')
raise RequestError("%s.%s: '%s'" % (enum_name, error_name, details), res)
return res
def decorate_check_error(error_enum):
"""Decorator to call `check_error` on the return value."""
def decorator(func):
@functools.wraps(func)
def _check_error(*args, **kwargs):
return check_error(func(*args, **kwargs), error_enum)
return _check_error
return decorator
# Create a mock error enum that has DESCRIPTOR and Name method
mock_error_enum = Mock()
mock_error_enum.DESCRIPTOR.full_name = "test.ErrorEnum"
mock_error_enum.Name.return_value = "UNKNOWN_ERROR"
ARGS = {
"error_enum": mock_error_enum
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|
| deprocess |
Ran ran, violated the contract we drafted |
wxj77/TransferReinforcementLearning/pix2pix-tensorflow/pix2pix.py code served (permissive licence) · get_code("4288f8e325eb43a4") 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 SymbolicTensor. 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 small test image tensor
# The function expects an image and applies (image + 1) / 2
# This is a typical deprocessing operation for images in range [-1, 1]
# Let's create a small image tensor with shape (2, 4, 4, 3) for batch of 2, 4x4 spatial, 3 channels
image_data = np.random.randn(2, 4, 4, 3).astype(np.float32) * 0.5
image = tf.constant(image_data)
ARGS = {
'image': image
}
- 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 SymbolicTensor — a SymbolicTensor 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
|
| discount |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
openai/universe-starter-agent/a3c.py pointer only (licence: MIT); the stored copy get_code serves, from braemt/attentive-multi-task-deep-reinforcement-learning, is pointer only (licence: MIT) · get_code("0ca7ce32a4f2492c") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from braemt/attentive-multi-task-deep-reinforcement-learning, and MIT, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| discount_rewards |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("9aaf2df19da77344") 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 (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
# discount_rewards takes:
# - x: Sequence (a sequence of values to discount)
# - gamma: float (discount factor)
# Create a small sequence of rewards
x = [1.0, 2.0, 3.0, 4.0, 5.0]
# Create a discount factor
gamma = 0.99
ARGS = {
"x": x,
"gamma": gamma,
}
- 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 ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| dqn_phi |
Ran ran on a synthesized input |
muupan/async-rl/dqn_phi.py code served (permissive licence) · get_code("8f06d9363ba6cccf") 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 3, dtype family float, shape (4, 84, 84) 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
# Create 4 screen objects as required by the function
# Each screen should be a numpy.ndarray with dtype uint8
# Using small 84x84 screens as typical for DQN on ALE
screen1 = np.random.randint(0, 256, size=(84, 84), dtype=np.uint8)
screen2 = np.random.randint(0, 256, size=(84, 84), dtype=np.uint8)
screen3 = np.random.randint(0, 256, size=(84, 84), dtype=np.uint8)
screen4 = np.random.randint(0, 256, size=(84, 84), dtype=np.uint8)
screens = [screen1, screen2, screen3, screen4]
ARGS = {
"screens": screens
}
- 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 ndarray, ndim 3, dtype family float, shape (4, 84, 84) — shape (4, 84, 84) 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
|
| entropy |
Ran ran; our contract draft was wrong, not the code |
qihongl/demo-advantage-actor-critic/src/models/_A2C_discrete.py code served (permissive licence) · get_code("57a38c7adc4b0687") 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 Tensor, 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
torch.manual_seed(0)
# The function expects:
# - probs: a torch vector (1D tensor) representing a probability distribution
# Create a small probability distribution vector
probs = torch.tensor([0.2, 0.3, 0.3, 0.2])
ARGS = {
"probs": probs
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 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
|
| env_runner |
Ran ran; our contract draft was wrong, not the code |
arnomoonens/yarll/yarll/agents/tf1/actorcritic/a3c_worker.py code served (permissive licence) · get_code("f4d1fbe08b721f31") 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 generator. 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
from collections import namedtuple
Experience = namedtuple('Experience', ['state', 'action', 'reward', 'next_state', 'value', 'features', 'terminal'])
class ExperiencesMemory(object):
"""Experience gathered from an environment."""
def __init__(self):
super().__init__()
self.experiences = []
self.steps = 0
def add(self, state, action, reward, value=None, features=None, terminal=False, next_state=None):
"""Add a single transition to the trajectory."""
exp = Experience(state, action, reward, next_state, value, features, terminal)
self.experiences.append(exp)
self.steps += 1
def extend(self, other):
"""
Extend a trajectory with another one.
"""
self.experiences.extend(other.experiences)
self.steps += other.steps
@property
def states(self):
return [exp.state for exp in self.experiences]
@property
def actions(self):
return [exp.action for exp in self.experiences]
@property
def rewards(self):
return [exp.reward for exp in self.experiences]
@property
def values(self):
return [exp.value for exp in self.experiences]
@property
def features(self):
return [exp.features for exp in self.experiences]
@property
def terminal(self):
"""Last experience is terminal."""
return self.experiences[-1].terminal
@property
def terminals(self):
return [exp.terminal for exp in self.experiences]
@property
def next_states(self):
return [exp.next_state for exp in self.experiences]
def __getitem__(self, i):
return self.experiences[i]
class SimplePolicy:
def __init__(self):
self.initial_features = np.array([0.1, 0.2, 0.3])
def choose_action(self, state, features):
return {
'action': 0,
'value': 0.5,
'features': np.array([0.1, 0.2, 0.3])
}
def get_env_action(self, action):
return action
class SimpleEnv:
def __init__(self):
self.spec = type('obj', (object,), {
'tags': {'wrapper_config.TimeLimit.max_episode_steps': 10}
})()
self.metadata = {'semantics.autoreset': True}
self.step_count = 0
self.max_steps = 3
def reset(self):
self.step_count = 0
return np.array([0.1, 0.2, 0.3, 0.4])
def step(self, action):
self.step_count += 1
state = np.array([0.5, 0.6, 0.7, 0.8])
reward = 1.0
terminal = self.step_count >= self.max_steps
info = {}
return state, reward, terminal, info
def render(self):
pass
env = SimpleEnv()
policy = SimplePolicy()
n_steps = 2
render = False
summary_writer = None
ARGS = {
'env': env,
'policy': policy,
'n_steps': n_steps,
'render': render,
'summary_writer': summary_writer
}
- 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 generator — a generator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a generator 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_single_random_run |
Ran ran on a synthesized input |
muupan/async-rl/demo_a3c_doom.py code served (permissive licence) · get_code("8c2dab8164363bac") 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 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 numpy as np
class MockEnv:
def __init__(self):
self.n_actions = 4
self.state = 0
self.step_count = 0
self.max_steps = 5
def reset(self):
self.step_count = 0
self.state = 0
return np.array([0.0, 0.1, 0.2, 0.3])
def step(self, action):
self.step_count += 1
self.state += action
obs = np.array([float(self.state), 0.1, 0.2, 0.3])
reward = float(action)
done = self.step_count >= self.max_steps
info = {}
return obs, reward, done, info
env = MockEnv()
ARGS = {
"env": env
}
- 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 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
|
| flatten |
Ran ran; our contract draft was wrong, not the code |
openai/universe-starter-agent/model.py pointer only (licence: MIT); the stored copy get_code serves, from pathak22/noreward-rl, is pointer only (licence: NOASSERTION) · get_code("1e1712b2e9449aaf") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from pathak22/noreward-rl, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| getLogger |
Ran ran on a synthesized input |
traai/async-deep-rl/algorithms/logging_utils.py code served (permissive licence) · get_code("78e6c31f39e7da74") 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 Logger. 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 logging
import logging.config
# The function getLogger(name) simply calls logging.getLogger(name)
# It requires a single parameter: name, which should be a string
# representing the logger name.
ARGS = {
"name": "test_logger"
}
- 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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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_savename_from_varname |
Ran ran; our contract draft was wrong, not the code |
deepsense-ai/Distributed-BA3C/src/tensorpack_cpu/tensorpack/RL/simulator.py code served (permissive licence) · get_code("17be7a0a9392e5cf") 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 re
def get_savename_from_varname(varname, varname_prefix=None, savename_prefix=None):
"""
:param varname: a variable name in the graph
:param varname_prefix: an optional prefix that may need to be removed in varname
:param savename_prefix: an optional prefix to append to all savename
:returns: the name used to save the variable
"""
name = varname
if 'towerp' in name:
return None
if 'tower' in name:
name = re.sub('tower[p0-9]+/', '', name)
if varname_prefix is not None and name.startswith(varname_prefix):
name = name[len(varname_prefix) + 1:]
if savename_prefix is not None:
name = savename_prefix + '/' + name
return name
ARGS = {
"varname": "weights/conv1",
"varname_prefix": "weights",
"savename_prefix": "model"
}
- 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
|
| huber_loss |
Ran ran, honoured the contract we drafted |
brett-daley/fast-dqn/fast_dqn/worker.py code served (permissive licence) · get_code("ed625c2fac5f95ea") 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 EagerTensor, 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 tensorflow as tf
import numpy as np
# Create a small tensor for testing
# The function expects a tensor and applies huber loss element-wise
x = tf.constant([[-2.0, -0.5, 0.5, 2.0], [-1.5, -0.2, 1.2, 3.0]], dtype=tf.float32)
ARGS = {
"x": x
}
- 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 EagerTensor, 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
|
| log_uniform |
Ran ran on a synthesized input |
miyosuda/async_deep_reinforce/a3c.py code served (permissive licence) · get_code("e889bf50d1048c73") 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 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 math
def log_uniform(lo, hi, rate):
log_lo = math.log(lo)
log_hi = math.log(hi)
v = log_lo * (1 - rate) + log_hi * rate
return math.exp(v)
ARGS = {
"lo": 0.1,
"hi": 10.0,
"rate": 0.5
}
- 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 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
|
| normalized_columns_initializer |
Ran ran; our contract draft was wrong, not the code |
dsinghnegi/atari_RL_agent/models/a3c.py code served (permissive licence) · get_code("96708b203eb62ef3") 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 Tensor, 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 torch
torch.manual_seed(0)
# The function expects:
# - weights: a tensor with a .size() method that returns dimensions
# The function uses weights.size() to create output of same shape
# Then it computes normalization across dimension 1
# So weights should be 2D: (num_columns, num_features)
weights = torch.randn(2, 4) # 2D tensor: rows are columns, cols are features
ARGS = {
"weights": weights,
"std": 1.0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 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
|
| normalized_columns_initializer |
Ran ran; our contract draft was wrong, not the code |
openai/universe-starter-agent/model.py pointer only (licence: MIT); the stored copy get_code serves, from pathak22/noreward-rl, is pointer only (licence: NOASSERTION) · get_code("ef2d50dfca29c664") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from pathak22/noreward-rl, and GitHub could not classify the licence of that repository (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| preprocess |
Ran ran, violated the contract we drafted |
wxj77/TransferReinforcementLearning/pix2pix-tensorflow/pix2pix.py code served (permissive licence) · get_code("7b296d580bba710b") 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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 4, 3) 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 tensorflow as tf
import numpy as np
# Create a small test image tensor
# The function takes an image and applies: image * 2 - 1
# This is a simple preprocessing operation
image = tf.constant(np.random.rand(2, 4, 4, 3).astype(np.float32))
ARGS = {
'image': image
}
- 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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 4, 3) — shape (2, 4, 4, 3) 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
|
| preprocess |
Ran ran on a synthesized input |
wtingda/DeepRLBreakout/utils.py code served (permissive licence) · get_code("377aa232f0c85e8a") 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 int, shape (84, 84) 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
# Create a small valid RGB image for testing
# The function expects an image that can be converted to grayscale and resized
# Creating a 100x100 RGB image with random values
image = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
ARGS = {
"image": image
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, skimage — 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 int, shape (84, 84) — shape (84, 84) 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
|
| process_rollout |
Ran ran on a synthesized input |
openai/universe-starter-agent/a3c.py code served (permissive licence) · get_code("c08cb06eb2decc4f") 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 Batch. 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 collections import namedtuple
# Create a simple rollout class with the required attributes
class Rollout:
def __init__(self):
# States: batch of 2, state dim 4
self.states = [np.array([1.0, 2.0, 3.0, 4.0]),
np.array([5.0, 6.0, 7.0, 8.0])]
# Actions: batch of 2, action dim 3
self.actions = [np.array([0.1, 0.2, 0.3]),
np.array([0.4, 0.5, 0.6])]
# Rewards: batch of 2
self.rewards = [1.0, 2.0]
# Values: batch of 2
self.values = [0.5, 1.5]
# Final value for bootstrapping
self.r = 2.5
# Terminal flag
self.terminal = False
# Features: shape (5, 4) - first element will be extracted
self.features = [np.array([[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0],
[9.0, 10.0, 11.0, 12.0],
[13.0, 14.0, 15.0, 16.0],
[17.0, 18.0, 19.0, 20.0]])]
rollout = Rollout()
ARGS = {
'rollout': rollout,
'gamma': 0.99,
'lambda_': 0.95
}
- 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 Batch — a Batch 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
|
| return_action_based_on_greedy_policy |
Ran ran on a synthesized input |
joshiatul/game_playing/bandits.py code served (permissive licence) · get_code("ed5d96fe8d3154e3") 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
torch.manual_seed(0)
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 1)
def return_design_matrix(self, decision_state, critic_model=False):
state, decision = decision_state
# state is a tensor, decision is an integer
# Return a feature vector and y
feature_vector = torch.randn(1, 4)
y = torch.randn(1, 1)
return feature_vector, y
def predict(self, feature_vector, critic_model=False):
# feature_vector shape: (1, 4)
# Return a scalar reward
output = self.linear(feature_vector)
return output.item()
# Create test data
state = torch.randn(1, 4)
model = MockModel()
all_possible_decisions = [0, 1, 2]
ARGS = {
"state": state,
"model": model,
"all_possible_decisions": all_possible_decisions
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, 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
|
| return_action_based_on_softmax_policy |
Ran ran on a synthesized input |
joshiatul/game_playing/bandits.py code served (permissive licence) · get_code("1d9dd2285a2adf70") 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
import math
torch.manual_seed(0)
np.random.seed(0)
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(8, 1)
self._exists = True
def if_exists(self):
return self._exists
def return_design_matrix(self, decision_state, critic_model=False):
# decision_state is a tuple of (state, decision)
# Return a feature vector and y value
feature_vector = torch.randn(1, 8)
y = torch.randn(1, 1)
return feature_vector, y
def predict(self, feature_vector, critic_model=False):
# Return a scalar reward
output = self.linear(feature_vector)
return output.item()
# Create model instance
model = MockModel()
# Define state and possible decisions
state = {"position": 0, "value": 1}
all_possible_decisions = ["action_1", "action_2", "action_3"]
ARGS = {
"state": state,
"model": model,
"all_possible_decisions": all_possible_decisions
}
- 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 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
|
| rgb2gray |
Ran ran on a synthesized input |
gungui98/deeprl-a3c-ai2thor/gym_ai2thor/image_processing.py code served (permissive licence) · get_code("8913d2fd69ed4aac") 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 3, dtype family float, shape (4, 5, 1) 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
# Create a small RGB image
# Shape: (height, width, channels) where channels=3 for RGB
# Using distinct dimensions: 4 height, 5 width, 3 channels
rgb_image = np.random.rand(4, 5, 3).astype(np.float32)
ARGS = {
"rgb": rgb_image
}
- 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 ndarray, ndim 3, dtype family float, shape (4, 5, 1) — shape (4, 5, 1) 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
|
| select_action_with_epsilon_greedy_policy |
Ran ran on a synthesized input |
joshiatul/game_playing/bandits.py code served (permissive licence) · get_code("5e53479e1a15eb8d") 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 random
torch.manual_seed(0)
random.seed(0)
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 1)
def if_exists(self):
return True
def return_design_matrix(self, decision_state, critic_model=False):
# decision_state is a tuple of (state, decision)
# Return a feature vector and y
feature_vector = torch.randn(1, 4)
y = torch.randn(1, 1)
return feature_vector, y
def predict(self, feature_vector, critic_model=False):
# Return a scalar reward value
output = self.linear(feature_vector)
return output.item()
# Create test state (list of values)
state = [0.1, 0.2, 0.3, 0.4]
# Create list of possible decisions
all_possible_decisions = [0, 1, 2, 3]
# Create model instance
model = MockModel()
# Define ARGS dictionary with all parameters
ARGS = {
"state": state,
"all_possible_decisions": all_possible_decisions,
"model": model,
"epsilon": 0.1,
"test": False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, 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
|
| sigmoid |
Ran ran, violated the contract we drafted |
wxj77/TransferReinforcementLearning/src/pongSimpleFunc.py pointer only (licence: MIT); the stored copy get_code serves, from XPixelGroup/SEAL, is pointer only (licence: NONE) · get_code("f35babe3912ec8b1") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from XPixelGroup/SEAL, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| smooth_hue_palette |
Ran ran on a synthesized input |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/colors.py pointer only (licence: MIT); the stored copy get_code serves, from deepmind/pysc2, is pointer only (licence: Apache-2.0) · get_code("ee4a38c9d2b4ba59") How it ranThe body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from deepmind/pysc2, and Apache-2.0, as GitHub detects it on that repository, is in the permissive set, but a licence decision keeps the body a pointer: its licence file names an outside party, so it may cover vendored code rather than the repository owner's files (recorded as pointer:licence_names_third_party_corporation). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| softmax |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
qihongl/demo-advantage-actor-critic/src/models/_A2C_discrete.py code served (permissive licence) · get_code("9559ea8ea49d3010") 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 Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a 1D tensor with raw logits
z = torch.randn(4)
# Create a positive float for beta (temperature parameter)
beta = 2.0
ARGS = {
"z": z,
"beta": beta
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| with_lock |
Ran ran on a synthesized input |
cdesilv1/sc2_ai_cdes/deepmind_api_modified/pysc2/lib/renderer_human.py code served (permissive licence) · get_code("676b86f7426c37b7") 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 function. 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 threading
import functools
def with_lock(lock):
"""Make sure the lock is held while in this function."""
def decorator(func):
@functools.wraps(func)
def _with_lock(*args, **kwargs):
with lock:
return func(*args, **kwargs)
return _with_lock
return decorator
# Create a simple lock object
lock = threading.Lock()
# Define arguments
ARGS = {
"lock": lock
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
|