| default_mlp_init |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/representation_models/cpc_model.py code served (permissive licence) · get_code("56aec01f040cabad") 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 flax.linen as nn
ARGS = {
"scale": 0.05
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax — 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
|
| draw_circle |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
johannesack/offlinerlstructurednonstationarity/custom_env/hip_environment.py code served (permissive licence) · get_code("63edece0ba36d0d6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 3, dtype family int, shape (256, 256, 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 jax
import jax.numpy as jnp
# Set up arguments for draw_circle function
edit_array = jnp.ones((256, 256, 3), dtype=jnp.uint8) * 100
pos = jnp.array([10.0, 20.0])
radius = 15.0
color = [255, 0, 0]
space_size = 50
size = 256
ARGS = {
'edit_array': edit_array,
'pos': pos,
'radius': radius,
'color': color,
'space_size': space_size,
'size': size
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 3, dtype family int, shape (256, 256, 3) — shape (256, 256, 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
|
| get_actor_loss |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/RLMethods/TD3BCTrainer.py code served (permissive licence) · get_code("de59f09f6434b29d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import flax
from flax import linen as nn
from flax.core import freeze
from typing import Any, Callable
# Define simple actor and critic modules
class SimpleActor(nn.Module):
@nn.compact
def __call__(self, obs, rng=None):
x = nn.Dense(8)(obs)
x = nn.relu(x)
x = nn.Dense(3)(x) # action dimension is 3
return x
class SimpleCritic(nn.Module):
@nn.compact
def __call__(self, obs, action, rng=None):
x = jnp.concatenate([obs, action], axis=-1)
x = nn.Dense(8)(x)
x = nn.relu(x)
q_value = nn.Dense(1)(x)
return q_value, None
# Initialize models
key = jax.random.PRNGKey(0)
key1, key2 = jax.random.split(key)
# Create dummy observations and actions for initialization
dummy_obs = jnp.ones((2, 4)) # batch_size=2, obs_dim=4
dummy_action = jnp.ones((2, 3)) # batch_size=2, action_dim=3
# Initialize actor
actor_model = SimpleActor()
actor_params = actor_model.init(key1, dummy_obs, rng=None)
actor_params = freeze(actor_params)
# Initialize critic
critic_model = SimpleCritic()
critic_params = critic_model.init(key2, dummy_obs, dummy_action, rng=None)
critic_params = freeze(critic_params)
# Create apply functions
actor_apply_fn = actor_model.apply
critic_apply_fn = critic_model.apply
# Create batch data
obs = jnp.ones((2, 4)) # batch_size=2, obs_dim=4
action = jnp.ones((2, 3)) # batch_size=2, action_dim=3
ARGS = {
"actor_params": actor_params,
"critic_params": critic_params,
"actor_apply_fn": actor_apply_fn,
"critic_apply_fn": critic_apply_fn,
"obs": obs,
"action": action,
"td3_alpha": None,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- chex, flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_actor_loss |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/RLMethods/TD3Trainer.py code served (permissive licence) · get_code("fdce303f39ae0a89") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import flax
from flax import linen as nn
from flax.core import FrozenDict
# Define minimal actor and critic models
class ActorModel(nn.Module):
@nn.compact
def __call__(self, obs, rng=None):
# Actor takes obs and returns action
x = nn.Dense(4)(obs)
return x
class CriticModel(nn.Module):
@nn.compact
def __call__(self, obs, action, rng=None):
# Critic takes obs and action, returns q_value and auxiliary info
x = jnp.concatenate([obs, action], axis=-1)
x = nn.Dense(4)(x)
q_value = nn.Dense(1)(x)
return q_value, None
# Initialize actor and critic
actor_model = ActorModel()
critic_model = CriticModel()
# Create dummy inputs for initialization
dummy_obs = jnp.ones((2, 4)) # batch_size=2, obs_dim=4
dummy_action = jnp.ones((2, 4)) # batch_size=2, action_dim=4
# Initialize parameters
rng = jax.random.PRNGKey(0)
rng, subkey = jax.random.split(rng)
actor_params = actor_model.init(subkey, dummy_obs)
actor_params = FrozenDict(actor_params)
rng, subkey = jax.random.split(rng)
critic_params = critic_model.init(subkey, dummy_obs, dummy_action)
critic_params = FrozenDict(critic_params)
# Create apply functions
def actor_apply_fn(params, obs, rng=None):
return actor_model.apply(params, obs, rng=rng)
def critic_apply_fn(params, obs, action, rng=None):
return critic_model.apply(params, obs, action, rng=rng)
# Create sample observations and actions
obs = jnp.ones((2, 4)) # batch_size=2, obs_dim=4
action = jnp.ones((2, 4)) # batch_size=2, action_dim=4
ARGS = {
'actor_params': actor_params,
'critic_params': critic_params,
'actor_apply_fn': actor_apply_fn,
'critic_apply_fn': critic_apply_fn,
'obs': obs,
'action': action,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- chex, flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_critic_loss |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/RLMethods/TD3Trainer.py code served (permissive licence) · get_code("9c036454791018b3") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import flax.core
from flax import linen as nn
from typing import Any, Callable
# Set up JAX RNG key
rng_key = jax.random.PRNGKey(0)
# Create a simple critic module that outputs two Q-values
class CriticModule(nn.Module):
@nn.compact
def __call__(self, obs, action, rng=None):
x = jnp.concatenate([obs, action], axis=-1)
q1 = nn.Dense(1)(x)
q2 = nn.Dense(1)(x)
return q1, q2
# Create a simple actor module that outputs an action
class ActorModule(nn.Module):
@nn.compact
def __call__(self, obs, rng=None):
x = nn.Dense(4)(obs)
action = nn.Dense(3)(x)
return action
# Initialize critic and actor modules
critic_module = CriticModule()
actor_module = ActorModule()
# Create dummy inputs for initialization
batch_size = 2
obs_dim = 4
action_dim = 3
dummy_obs = jnp.ones((batch_size, obs_dim))
dummy_action = jnp.ones((batch_size, action_dim))
# Initialize critic params
critic_params = critic_module.init(rng_key, dummy_obs, dummy_action)
critic_target_params = critic_module.init(rng_key, dummy_obs, dummy_action)
# Initialize actor params
actor_target_params = actor_module.init(rng_key, dummy_obs)
# Convert to FrozenDict
critic_params = flax.core.frozen_dict.FrozenDict(critic_params)
critic_target_params = flax.core.frozen_dict.FrozenDict(critic_target_params)
actor_target_params = flax.core.frozen_dict.FrozenDict(actor_target_params)
# Create apply functions
def critic_apply_fn(params, obs, action, rng=None):
return critic_module.apply(params, obs, action, rng=rng)
def actor_apply_fn(params, obs, rng=None):
return actor_module.apply(params, obs, rng=rng)
# Create batch data
obs = jnp.ones((batch_size, obs_dim))
action = jnp.ones((batch_size, action_dim))
reward = jnp.array([1.0, 0.5])
done = jnp.array([0.0, 1.0])
next_obs = jnp.ones((batch_size, obs_dim))
# Hyperparameters
decay = 0.99
policy_noise_std = 0.2
policy_noise_clip = 0.5
max_action = 1.0
ARGS = {
'critic_params': critic_params,
'critic_target_params': critic_target_params,
'actor_target_params': actor_target_params,
'critic_apply_fn': critic_apply_fn,
'actor_apply_fn': actor_apply_fn,
'obs': obs,
'action': action,
'reward': reward,
'done': done,
'next_obs': next_obs,
'decay': decay,
'policy_noise_std': policy_noise_std,
'policy_noise_clip': policy_noise_clip,
'max_action': max_action,
'rng_key': rng_key
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- chex, flax, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_linear_probeacc_realtrain_faketest |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
johannesack/offlinerlstructurednonstationarity/representation_models/latent_predictor_model.py code served (permissive licence) · get_code("9a00239e9a2e6660") 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 jax.numpy as jnp
import numpy as np
# Construct small test arrays for the function
# train_latents: shape (n, m, d) - n samples, m sequence length, d dimensions
# test_latents: shape (n, d) - n samples, d dimensions
# train_hips: shape (n, m) - n samples, m sequence length with hip labels
# test_hips: shape (n,) - n samples with hip labels
n_train = 2 # number of training samples
m = 3 # sequence length
d = 4 # latent dimension
n_test = 2 # number of test samples
# Create training latents: (2, 3, 4)
train_latents = jnp.ones((n_train, m, d), dtype=jnp.float32) * np.random.randn(n_train, m, d)
# Create test latents: (2, 4)
test_latents = jnp.ones((n_test, d), dtype=jnp.float32) * np.random.randn(n_test, d)
# Create training hips: (2, 3) with class labels 0, 1, 2
train_hips = np.array([[0, 1, 2], [0, 1, 2]], dtype=np.int32)
# Create test hips: (2,) with class labels from the same set
test_hips = np.array([0, 1], dtype=np.int32)
ARGS = {
'train_latents': train_latents,
'test_latents': test_latents,
'train_hips': train_hips,
'test_hips': test_hips,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, jax, numpy, sklearn — 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
|
| get_mse_loss |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/representation_models/latent_predictor_model.py code served (permissive licence) · get_code("b9e2cfcaab3117fa") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ArrayImpl, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import chex
# Set JAX random seed for reproducibility
key = jax.random.PRNGKey(0)
# Create a simple apply function that takes params, context_latents, and rng
# and returns a predicted next latent
def simple_apply_fn(params, context_latents, rng):
# Simple linear transformation: multiply context_latents by params weight
return jnp.dot(context_latents, params['weight']) + params['bias']
# Create params as an ArrayTree (dict of arrays in this case)
params = {
'weight': jnp.ones((4, 5)), # 4x5 weight matrix
'bias': jnp.zeros(5) # 5-dim bias vector
}
# Create context_latents with shape (2, 4) - batch of 2, dim 4
context_latents = jnp.ones((2, 4))
# Create next_latent_target with shape (2, 5) - batch of 2, dim 5 (matches output of apply_fn)
next_latent_target = jnp.ones((2, 5)) * 2.0
# Create a JAX random key
rng = jax.random.PRNGKey(42)
ARGS = {
'params': params,
'apply_fn': simple_apply_fn,
'context_latents': context_latents,
'next_latent_target': next_latent_target,
'rng': rng
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- chex, jax — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ArrayImpl, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| orthogonal_init |
Ran ran; our contract draft was wrong, not the code |
johannesack/offlinerlstructurednonstationarity/RLMethods/rl_models.py code served (permissive licence) · get_code("0e1815d7327a86a7") 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 math
from typing import Optional
import flax.linen as nn
def orthogonal_init(scale: Optional[float] = math.sqrt(2)):
return nn.initializers.orthogonal(scale)
# The function takes a single parameter 'scale' which is Optional[float]
# with a default value of math.sqrt(2)
# The function body simply returns nn.initializers.orthogonal(scale)
# so we need to provide a valid scale value
ARGS = {
"scale": math.sqrt(2)
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- flax — 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
|
| sample_batch |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
johannesack/offlinerlstructurednonstationarity/RLMethods/TD3BCTrainer.py code served (permissive licence) · get_code("9e7e7578eb33e5fc") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import numpy as np
from functools import partial
# Create a small stand-in config class
class Config:
def __init__(self):
self.offline = OfflineConfig()
class OfflineConfig:
def __init__(self):
self.batch_size = 2
# Create the buffer dictionary with jax arrays
buffer = {
'states': jnp.ones((5, 4)), # 5 existing samples, 4 dimensional
'actions': jnp.ones((5, 3)), # 5 existing samples, 3 dimensional actions
'rewards': jnp.ones((5,)), # 5 rewards
'next_states': jnp.ones((5, 4)), # 5 next states, 4 dimensional
'dones': jnp.zeros((5,)), # 5 done flags
}
# Create RNG key for jax.random
rng = jax.random.PRNGKey(0)
# Create config
config = Config()
# Number of existing samples in the buffer
num_existing_samples = 5
ARGS = {
'buffer': buffer,
'num_existing_samples': num_existing_samples,
'config': config,
'rng': rng,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| sample_batch |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
johannesack/offlinerlstructurednonstationarity/RLMethods/TD3Trainer.py code served (permissive licence) · get_code("9dcf8cb33934578d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import jax
import jax.numpy as jnp
import numpy as np
# Set up small tensors for the buffer
num_existing_samples = 5
num_train_envs = 3
obs_dim = 4
action_dim = 2
# Create a buffer dict with the required keys
# Each array has shape (num_existing_samples, num_train_envs, ...)
buffer = {
'states': jnp.ones((num_existing_samples, num_train_envs, obs_dim), dtype=jnp.float32),
'actions': jnp.ones((num_existing_samples, num_train_envs, action_dim), dtype=jnp.float32),
'rewards': jnp.ones((num_existing_samples, num_train_envs), dtype=jnp.float32),
'next_states': jnp.ones((num_existing_samples, num_train_envs, obs_dim), dtype=jnp.float32),
'dones': jnp.ones((num_existing_samples, num_train_envs), dtype=jnp.bool_),
}
# Create RNG key for JAX
rng = jax.random.PRNGKey(0)
# Define arguments
ARGS = {
'buffer': buffer,
'num_existing_samples': num_existing_samples,
'batch_size': 2,
'num_train_envs': num_train_envs,
'rng': rng,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_ant_xml |
Not yet run unverified (harvested, no recorded run) |
johannesack/offlinerlstructurednonstationarity/custom_env/leglen_ant.py code served (permissive licence) · get_code("716cf1c3bc60674c") How it ran |
| sample_batch_and_update |
Not yet run unverified (harvested, no recorded run) |
johannesack/offlinerlstructurednonstationarity/representation_models/latent_predictor_model.py code served (permissive licence) · get_code("edb5ab405906d972") How it ran |