| backtrace |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("fbab057971ecf3f4") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, 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 numpy as np
import numba as nb
# Set random seed for reproducibility
np.random.seed(0)
# Create small test data
# x: sequence of state indices, shape (time_steps,)
x = np.array([0, 1, 0, 1], dtype=np.int64)
# n_clones: number of clones per state, shape (n_states,)
n_clones = np.array([2, 3], dtype=np.int64)
# a: action indices at each time step, shape (time_steps - 1,)
a = np.array([0, 1, 0], dtype=np.int64)
# T: transition tensor, shape (n_actions, total_state_clones, total_state_clones)
# total_state_clones = sum(n_clones) = 5
n_actions = 2
total_clones = n_clones.sum()
T = np.random.randn(n_actions, total_clones, total_clones)
# mess_fwd: forward messages, shape (total_message_size,)
# The function computes mess_loc based on n_clones[x]
# For x = [0, 1, 0, 1], n_clones[x] = [2, 3, 2, 3]
# mess_loc cumsum: [0, 2, 5, 7, 10]
# So we need mess_fwd of size 10
mess_fwd = np.random.randn(10)
ARGS = {
'T': T,
'n_clones': n_clones,
'x': x,
'a': a,
'mess_fwd': mess_fwd
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family int, 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
|
| backtraceE |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("dcda7c0cf75598ee") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family int, 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
import numba as nb
@nb.njit
def rargmax(x):
return np.random.choice((x == x.max()).nonzero()[0])
def backtraceE(T, E, n_clones, x, a, mess_fwd):
"""Compute backward messages."""
assert (n_clones.sum(), len(n_clones)) == E.shape
states = np.zeros(x.shape[0], dtype=np.int64)
t = x.shape[0] - 1
belief = mess_fwd[t]
states[t] = rargmax(belief)
for t in range(x.shape[0] - 2, -1, -1):
aij = a[t]
belief = mess_fwd[t] * T[aij, :, states[t + 1]]
states[t] = rargmax(belief)
return states
# Set random seed for reproducibility
np.random.seed(0)
# Define dimensions
n_timesteps = 5
n_states = 4
n_clones_val = 3
n_actions = 2
# n_clones: array of clone counts, shape (n_clones_val,)
n_clones = np.array([2, 3, 1], dtype=np.int64)
# E: shape (n_clones.sum(), len(n_clones)) = (6, 3)
E = np.random.randn(n_clones.sum(), len(n_clones))
# x: observation sequence, shape (n_timesteps,)
x = np.random.randn(n_timesteps)
# a: action sequence, shape (n_timesteps - 1,), values in [0, n_actions)
a = np.array([0, 1, 0, 1], dtype=np.int64)
# T: transition tensor, shape (n_actions, n_states, n_states)
T = np.random.randn(n_actions, n_states, n_states)
# mess_fwd: forward messages, shape (n_timesteps, n_states)
mess_fwd = np.random.randn(n_timesteps, n_states)
ARGS = {
'T': T,
'E': E,
'n_clones': n_clones,
'x': x,
'a': a,
'mess_fwd': mess_fwd
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family int, 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
|
| backtrace_all |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("035bb3da1eef4c87") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 2, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import numba as nb
@nb.njit
def rargmax(x):
return np.random.choice((x == x.max()).nonzero()[0])
def backtrace_all(T, Pi_a, n_clones, mess_fwd, target_state):
"""Compute backward messages."""
states = np.zeros(mess_fwd.shape[0], dtype=np.int64)
actions = np.zeros(mess_fwd.shape[0], dtype=np.int64)
n_states = T.shape[1]
t = mess_fwd.shape[0] - 1
actions[t], states[t] = (-1, target_state)
for t in range(mess_fwd.shape[0] - 2, -1, -1):
belief = mess_fwd[t].reshape(1, -1) * T[:, :, states[t + 1]] * Pi_a.reshape(-1, 1)
a_s = rargmax(belief.flatten())
actions[t], states[t] = (a_s // n_states, a_s % n_states)
return (actions, states)
# Set seed for reproducibility
np.random.seed(0)
# Construct arguments
# T: shape (n_actions, n_states, n_states) - transition tensor
n_actions = 3
n_states = 4
T = np.random.rand(n_actions, n_states, n_states)
# Pi_a: shape (n_actions,) - action prior/policy
Pi_a = np.random.rand(n_actions)
# n_clones: integer parameter
n_clones = 2
# mess_fwd: shape (time_steps, n_states) - forward messages
time_steps = 5
mess_fwd = np.random.rand(time_steps, n_states)
# target_state: integer in range [0, n_states)
target_state = 2
ARGS = {
"T": T,
"Pi_a": Pi_a,
"n_clones": n_clones,
"mess_fwd": mess_fwd,
"target_state": target_state,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 2, dtype family int — 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
|
| backward |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("be72df6bce23ce68") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 1, dtype family float, shape (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
import numba as nb
# Analyze the function to understand parameter requirements:
# T: 3D array indexed as T[aij, i_start:i_stop, j_start:j_stop]
# n_clones: 1D array of integers, used for indexing and cumsum
# x: 1D array of integers, indices into n_clones and state_loc
# a: 1D array of integers, indices into T's first dimension
# Create small but distinct dimensions
# Let's say we have 3 states, 4 time steps, 2 actions
# n_clones: number of clones for each state
# We'll have 3 states with different clone counts
n_clones = np.array([2, 3, 2], dtype=np.int64)
# x: sequence of state indices over time (length 4)
# Values must be valid indices into n_clones (0, 1, or 2)
x = np.array([0, 1, 2, 1], dtype=np.int64)
# a: action indices for each transition (length 3, since we have 4 time steps)
# Values must be valid indices into T's first dimension
a = np.array([0, 1, 0], dtype=np.int64)
# T: transition matrix
# Shape: (n_actions, total_states, total_states)
# total_states = sum(n_clones) = 2 + 3 + 2 = 7
n_actions = 2
total_states = int(n_clones.sum())
T = np.random.randn(n_actions, total_states, total_states).astype(np.float64)
# Make it positive for numerical stability
T = np.abs(T) + 0.1
ARGS = {
'T': T,
'n_clones': n_clones,
'x': x,
'a': a
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 1, dtype family float, shape (10,) — shape (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
|
| backwardE |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("34bf25d3a0edc995") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned ndarray, ndim 2, dtype family float, shape (5, 6) 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 random seed for reproducibility
np.random.seed(0)
# Parameters based on function signature and usage:
# T: transition matrix, indexed by T[aij] where aij comes from a[t]
# E: emission matrix with shape (n_clones.sum(), len(n_clones))
# n_clones: array that sums to E.shape[0]
# x: sequence of indices, x.shape[0] is time steps
# a: action/transition indices for each time step
# Create n_clones: array of clone counts that sum to some value
n_clones = np.array([2, 3, 1], dtype=np.int64) # 3 clones with counts 2, 3, 1
n_clones_sum = n_clones.sum() # = 6
# Create E: emission matrix with shape (n_clones.sum(), len(n_clones))
# Shape should be (6, 3)
E = np.random.rand(n_clones_sum, len(n_clones)).astype(np.float64)
# Create x: sequence of time steps with indices into E's second dimension
# x.shape[0] is number of time steps, values should be in range [0, len(n_clones))
x = np.array([0, 1, 2, 1, 0], dtype=np.int64) # 5 time steps
# Create a: action/transition indices for each time step (except last)
# a[t] is used to index T, so we need valid indices
# Let's say T has shape (4, 6, 6) - 4 possible actions, 6x6 transition matrices
n_actions = 4
a = np.array([0, 1, 2, 1], dtype=np.int64) # 4 actions for time steps 0-3
# Create T: transition matrix indexed by action
# T[aij] should be a matrix that can be dotted with a vector of length E.shape[0]
# T[aij] should have shape (E.shape[0], E.shape[0]) = (6, 6)
T = np.random.rand(n_actions, n_clones_sum, n_clones_sum).astype(np.float64)
# Normalize each transition matrix to be stochastic
for i in range(n_actions):
T[i] = T[i] / T[i].sum(axis=1, keepdims=True)
ARGS = {
'T': T,
'E': E,
'n_clones': n_clones,
'x': x,
'a': a
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- 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 (5, 6) — shape (5, 6) 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
|
| forward |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("701373520efd837b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import numba as nb
# Set random seed for reproducibility
np.random.seed(0)
# Create small test data
# n_clones: number of clones per state (shape: n_states,)
n_clones = np.array([2, 3, 2], dtype=np.int64)
n_states = len(n_clones)
# Total number of sub-states
n_substates = n_clones.sum()
# Pi: initial state probabilities (shape: n_substates,)
Pi = np.random.rand(n_substates).astype(np.float64)
Pi = Pi / Pi.sum() # normalize
# T_tr: transition matrices (shape: n_actions, n_substates_to, n_substates_from)
n_actions = 2
T_tr = np.random.rand(n_actions, n_substates, n_substates).astype(np.float64)
# Normalize each column to sum to 1
for a in range(n_actions):
for j in range(n_substates):
col_sum = T_tr[a, :, j].sum()
if col_sum > 0:
T_tr[a, :, j] /= col_sum
# x: sequence of state indices (shape: sequence_length,)
sequence_length = 4
x = np.array([0, 1, 2, 1], dtype=np.int64)
# a: sequence of action indices (shape: sequence_length - 1,)
a = np.array([0, 1, 0], dtype=np.int64)
# store_messages: boolean flag
store_messages = False
ARGS = {
'T_tr': T_tr,
'Pi': Pi,
'n_clones': n_clones,
'x': x,
'a': a,
'store_messages': store_messages
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, 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
|
| forward_mp |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("236a56bc2589a44f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import numba as nb
# Analyze the function to understand parameter requirements:
# - T_tr: 3D array indexed as T_tr[aij, j_start + d, i_start:i_stop]
# Shape should be (n_actions, n_states, n_states)
# - Pi: 1D array of initial probabilities, indexed by state ranges
# - n_clones: 1D array of state counts per observation type
# - x: 1D array of observation indices (sequence)
# - a: 1D array of action indices (sequence, length = len(x) - 1)
# - store_messages: boolean flag
# Create small test data
n_obs_types = 3 # number of observation types
n_actions = 2 # number of actions
n_states_per_obs = [2, 3, 2] # states for each observation type
total_states = sum(n_states_per_obs)
# n_clones: array of state counts per observation type
n_clones = np.array(n_states_per_obs, dtype=np.int64)
# Pi: initial state probabilities (one value per state)
Pi = np.random.rand(total_states).astype(np.float64)
Pi = Pi / Pi.sum() # normalize
# T_tr: transition matrix (n_actions, n_states, n_states)
T_tr = np.random.rand(n_actions, total_states, total_states).astype(np.float64)
# Normalize to ensure max > 0
T_tr = T_tr / (T_tr.max(axis=(1, 2), keepdims=True) + 1e-6)
# x: sequence of observation indices (must be valid indices into n_clones)
x = np.array([0, 1, 2, 1, 0], dtype=np.int64)
# a: sequence of action indices (length = len(x) - 1)
a = np.array([0, 1, 0, 1], dtype=np.int64)
# store_messages: boolean flag
store_messages = True
ARGS = {
'T_tr': T_tr,
'Pi': Pi,
'n_clones': n_clones,
'x': x,
'a': a,
'store_messages': store_messages
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, 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
|
| rargmax |
Ran ran, honoured the contract we drafted |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("fce610cfa177feb6") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import numba as nb
@nb.njit
def rargmax(x):
return np.random.choice((x == x.max()).nonzero()[0])
# Create a small numpy array with some values
x = np.array([1.0, 5.0, 3.0, 5.0, 2.0])
ARGS = {
"x": x
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- numba, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, 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
|
| CHMM |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("8ecc57903dd4d95a") How it ran |
| forwardE |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("ab42ab54d530bf21") How it ran |
| forwardE_mp |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("acecc5d1c599c77e") How it ran |
| forward_mp_all |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("01c78fa51023b405") How it ran |
| updateC |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("8f9771e83e7a0ea9") How it ran |
| updateCE |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("ed669dfc84395fcb") How it ran |
| validate_seq |
Not yet run unverified (harvested, no recorded run) |
vicariousinc/naturecomm_cscg/chmm_actions.py code served (permissive licence) · get_code("ee6a374ee8affe7a") How it ran |