| AbstractActor |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("676367224566988e") 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 TruncatedNormal. 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 abc
class AbstractMLP(torch.nn.Module, metaclass=abc.ABCMeta):
"""Abstract base class for all feedforward networks."""
def __init__(self, input_dimension: int, output_dimension: int, hidden_dimension: int, hidden_layers: int, activation: str, device: torch.device, preprocessor: bool=False, layernorm: bool=False):
self._input_dimension = input_dimension
self._output_dimension = output_dimension
self._hidden_dimension = hidden_dimension
self._hidden_layers = hidden_layers
self._activation = activation
self.device = device
self._preprocessor = preprocessor
self._layernorm = layernorm
super().__init__()
self.trunk = self._build()
def _build(self) -> torch.nn.Sequential:
"""
Creates MLP trunk.
"""
if self.hidden_layers == 0:
function = [torch.nn.Linear(self.input_dimension, self.output_dimension)]
else:
if self._layernorm:
function = [torch.nn.Linear(self.input_dimension, self.hidden_dimension), torch.nn.LayerNorm(self.hidden_dimension), torch.nn.Tanh()]
else:
function = [torch.nn.Linear(self.input_dimension, self.hidden_dimension), self.activation]
for _ in range(self.hidden_layers - 1):
function += [torch.nn.Linear(self.hidden_dimension, self.hidden_dimension), self.activation]
function.append(torch.nn.Linear(self.hidden_dimension, self.output_dimension))
if self.preprocessor:
function.append(self.activation)
trunk = torch.nn.Sequential(*function).to(self.device)
return trunk
@property
def input_dimension(self) -> int:
return self._input_dimension
@property
def output_dimension(self) -> int:
return self._output_dimension
@property
def hidden_dimension(self) -> int:
return self._hidden_dimension
@property
def hidden_layers(self) -> int:
return self._hidden_layers
@property
def activation(self) -> torch.nn:
if self._activation == 'relu':
return torch.nn.ReLU()
else:
raise NotImplementedError(f'{self._activation} not implemented.')
@property
def preprocessor(self) -> bool:
return self._preprocessor
class TruncatedNormal(torch.distributions.Normal):
"""Implementation of the Truncated Normal distribution."""
def __init__(self, loc, scale, low=-1.0, high=1.0, eps=1e-06) -> None:
super().__init__(loc, scale, validate_args=False)
self.low = low
self.high = high
self.eps = eps
def _clamp(self, x) -> torch.Tensor:
clamped_x = torch.clamp(x, self.low + self.eps, self.high - self.eps)
x = x - x.detach() + clamped_x.detach()
return x
def sample(self, clip=None, sample_shape=torch.Size()) -> torch.Tensor:
shape = self._extended_shape(sample_shape)
eps = torch.distributions.utils._standard_normal(shape, dtype=self.loc.dtype, device=self.loc.device)
eps *= self.scale
if clip is not None:
eps = torch.clamp(eps, -clip, clip)
x = self.loc + eps
return self._clamp(x)
class AbstractActor(AbstractMLP, metaclass=abc.ABCMeta):
"""Abstract actor that selects action given input."""
def __init__(self, observation_length: int, action_length: int, hidden_dimension: int, hidden_layers: int, activation: str, device: torch.device):
super().__init__(input_dimension=observation_length, output_dimension=action_length, hidden_dimension=hidden_dimension, hidden_layers=hidden_layers, activation=activation, device=device, layernorm=True)
def forward(self, observation: torch.Tensor, std: float) -> torch.distributions.Distribution:
"""
Passes input through network to predict action
Args:
observation: obs tensor of shape [batch_dim, input_length]
std: standard deviation of action distribution
Returns:
action: action tensor of shape [batch_dim, action_length]
"""
if observation.shape[-1] != self.input_dimension:
raise ValueError(f'Input shape {observation.shape} does not match input dimension {self.input_dimension}')
mu = self.trunk(observation)
mu = torch.tanh(mu)
std = torch.ones_like(mu) * std
dist = TruncatedNormal(mu, std)
return dist
INIT_ARGS = {
'observation_length': 4,
'action_length': 3,
'hidden_dimension': 8,
'hidden_layers': 2,
'activation': 'relu',
'device': torch.device('cpu')
}
ARGS = {
'observation': torch.randn(2, 4),
'std': 0.1
}
if __name__ == '__main__':
actor = AbstractActor(**INIT_ARGS)
dist = actor(**ARGS)
sample = dist.sample()
print(f"Distribution: {dist}")
print(f"Sample shape: {sample.shape}")
print(f"Sample: {sample}")
- 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 TruncatedNormal — a TruncatedNormal output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a TruncatedNormal 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)
|
| AbstractGaussianActor |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("350547f0b8b706cb") 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 SquashedNormal. 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
INIT_ARGS = {
'observation_length': 4,
'action_length': 3,
'hidden_dimension': 8,
'hidden_layers': 2,
'activation': 'relu',
'device': torch.device('cpu'),
'log_std_bounds': (-5.0, 2.0)
}
ARGS = {
'observation': torch.randn(2, 4) # batch_dim=2, observation_length=4
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type SquashedNormal — a SquashedNormal output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SquashedNormal 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)
|
| AbstractPreprocessor |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("a9f70659526f31de") 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; 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
# INIT_ARGS for AbstractPreprocessor.__init__
INIT_ARGS = {
'observation_length': 5,
'concatenated_variable_length': 3,
'hidden_dimension': 8,
'feature_space_dimension': 4,
'hidden_layers': 2,
'activation': 'relu',
'device': torch.device('cpu')
}
# ARGS for forward method
# concatenation shape: [batch_dim, observation_length + concatenated_variable_length]
# = [batch_dim, 5 + 3] = [batch_dim, 8]
ARGS = {
'concatenation': torch.randn(2, 8)
}
- 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| BackwardModel |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("815b8b7187def028") 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; 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
# INIT_ARGS for BackwardModel.__init__
INIT_ARGS = {
'observation_length': 6,
'z_dimension': 4,
'hidden_dimension': 8,
'hidden_layers': 2,
'device': torch.device('cpu'),
'activation': 'relu'
}
# ARGS for BackwardModel.forward
ARGS = {
'observation': torch.randn(2, 6) # batch_size=2, observation_length=6
}
- 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| BackwardRepresentation |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("ff9f5d55817b5b9e") 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; 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
device = torch.device('cpu')
INIT_ARGS = {
'observation_length': 4,
'z_dimension': 3,
'backward_hidden_dimension': 8,
'backward_hidden_layers': 2,
'device': device,
'backward_activation': 'relu',
}
ARGS = {
'observation': torch.randn(2, 4),
}
- 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| ForwardModel |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("23d435a38e160c8d") 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, 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 torch
import abc
class AbstractMLP(torch.nn.Module, metaclass=abc.ABCMeta):
"""Abstract base class for all feedforward networks."""
def __init__(self, input_dimension: int, output_dimension: int, hidden_dimension: int, hidden_layers: int, activation: str, device: torch.device, preprocessor: bool=False, layernorm: bool=False):
self._input_dimension = input_dimension
self._output_dimension = output_dimension
self._hidden_dimension = hidden_dimension
self._hidden_layers = hidden_layers
self._activation = activation
self.device = device
self._preprocessor = preprocessor
self._layernorm = layernorm
super().__init__()
self.trunk = self._build()
def _build(self) -> torch.nn.Sequential:
"""
Creates MLP trunk.
"""
if self.hidden_layers == 0:
function = [torch.nn.Linear(self.input_dimension, self.output_dimension)]
else:
if self._layernorm:
function = [torch.nn.Linear(self.input_dimension, self.hidden_dimension), torch.nn.LayerNorm(self.hidden_dimension), torch.nn.Tanh()]
else:
function = [torch.nn.Linear(self.input_dimension, self.hidden_dimension), self.activation]
for _ in range(self.hidden_layers - 1):
function += [torch.nn.Linear(self.hidden_dimension, self.hidden_dimension), self.activation]
function.append(torch.nn.Linear(self.hidden_dimension, self.output_dimension))
if self.preprocessor:
function.append(self.activation)
trunk = torch.nn.Sequential(*function).to(self.device)
return trunk
@property
def input_dimension(self) -> int:
return self._input_dimension
@property
def output_dimension(self) -> int:
return self._output_dimension
@property
def hidden_dimension(self) -> int:
return self._hidden_dimension
@property
def hidden_layers(self) -> int:
return self._hidden_layers
@property
def activation(self) -> torch.nn:
if self._activation == 'relu':
return torch.nn.ReLU()
else:
raise NotImplementedError(f'{self._activation} not implemented.')
@property
def preprocessor(self) -> bool:
return self._preprocessor
class ForwardModel(AbstractMLP):
"""
Predicts the expected future states (measure) given an
embedding of a current state-action pair and policy parameterised by z.
"""
def __init__(self, preprocessor_feature_space_dimension: int, number_of_preprocessed_features: int, z_dimension: int, hidden_dimension: int, hidden_layers: int, device: torch.device, activation: str):
super().__init__(input_dimension=preprocessor_feature_space_dimension * number_of_preprocessed_features, output_dimension=z_dimension, hidden_dimension=hidden_dimension, hidden_layers=hidden_layers, activation=activation, device=device)
def forward(self, h: torch.Tensor) -> torch.Tensor:
"""
Takes observation, action, z, preprocesses and forwards into z-space.
Args:
h: preprocessed/embedded obs/action/z tensor of shape
[batch_dim, preprocessor_feature_space_dimension * number_of_features]
Returns:
z_: embedded tensor of shape [batch_dim, z_dimension]
"""
z_ = self.trunk(h)
return z_
INIT_ARGS = {
'preprocessor_feature_space_dimension': 4,
'number_of_preprocessed_features': 3,
'z_dimension': 5,
'hidden_dimension': 8,
'hidden_layers': 2,
'device': torch.device('cpu'),
'activation': 'relu',
}
ARGS = {
'h': torch.randn(2, 12),
}
- 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, 5) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| SquashedNormal |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("6360b567a0112530") 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; 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 math
class TanhTransform(torch.distributions.transforms.Transform):
"""Implementation of the Tanh transformation."""
domain = torch.distributions.constraints.real
codomain = torch.distributions.constraints.interval(-1.0, 1.0)
bijective = True
sign = +1
def __init__(self, cache_size=1):
super().__init__(cache_size=cache_size)
@staticmethod
def atanh(x):
return 0.5 * (x.log1p() - (-x).log1p())
def __eq__(self, other):
return isinstance(other, TanhTransform)
def _call(self, x):
return x.tanh()
def _inverse(self, y):
return self.atanh(y)
def log_abs_det_jacobian(self, x, y):
return 2.0 * (math.log(2.0) - x - torch.nn.functional.softplus(-2.0 * x))
class SquashedNormal(torch.distributions.transformed_distribution.TransformedDistribution):
"""Implementation of the Squashed Normal distribution."""
def __init__(self, loc, scale):
self.loc = loc
self.scale = scale
self.base_dist = torch.distributions.Normal(loc, scale)
transforms = [TanhTransform()]
super().__init__(self.base_dist, transforms)
@property
def mean(self):
mu = self.loc
for tr in self.transforms:
mu = tr(mu)
return mu
INIT_ARGS = {
'loc': torch.tensor([0.5, -0.3, 1.2]),
'scale': torch.tensor([1.0, 0.8, 1.5])
}
ARGS = {
'sample_shape': torch.Size([2])
}
METHOD = 'sample'
- 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| TanhTransform |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("18d2cc67d612e1e4") 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, 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
import math
class TanhTransform(torch.distributions.transforms.Transform):
"""Implementation of the Tanh transformation."""
domain = torch.distributions.constraints.real
codomain = torch.distributions.constraints.interval(-1.0, 1.0)
bijective = True
sign = +1
def __init__(self, cache_size=1):
super().__init__(cache_size=cache_size)
@staticmethod
def atanh(x):
return 0.5 * (x.log1p() - (-x).log1p())
def __eq__(self, other):
return isinstance(other, TanhTransform)
def _call(self, x):
return x.tanh()
def _inverse(self, y):
return self.atanh(y)
def log_abs_det_jacobian(self, x, y):
return 2.0 * (math.log(2.0) - x - torch.nn.functional.softplus(-2.0 * x))
INIT_ARGS = {
'cache_size': 1
}
ARGS = {
'x': torch.randn(2, 4),
'y': torch.tanh(torch.randn(2, 4))
}
METHOD = 'log_abs_det_jacobian'
if __name__ == '__main__':
transform = TanhTransform(**INIT_ARGS)
result = getattr(transform, METHOD)(**ARGS)
print(f"Result shape: {result.shape}")
print(f"Result: {result}")
- 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, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| TruncatedNormal |
Ran ran on a synthesized input |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("eb6b6a9c095395c9") 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 3, dtype family float, shape (2, 3, 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
class TruncatedNormal(torch.distributions.Normal):
"""Implementation of the Truncated Normal distribution."""
def __init__(self, loc, scale, low=-1.0, high=1.0, eps=1e-06) -> None:
super().__init__(loc, scale, validate_args=False)
self.low = low
self.high = high
self.eps = eps
def _clamp(self, x) -> torch.Tensor:
clamped_x = torch.clamp(x, self.low + self.eps, self.high - self.eps)
x = x - x.detach() + clamped_x.detach()
return x
def sample(self, clip=None, sample_shape=torch.Size()) -> torch.Tensor:
shape = self._extended_shape(sample_shape)
eps = torch.distributions.utils._standard_normal(shape, dtype=self.loc.dtype, device=self.loc.device)
eps *= self.scale
if clip is not None:
eps = torch.clamp(eps, -clip, clip)
x = self.loc + eps
return self._clamp(x)
INIT_ARGS = {
'loc': torch.tensor([0.0, 0.5, -0.3, 0.2]),
'scale': torch.tensor([0.1, 0.2, 0.15, 0.25]),
'low': -1.0,
'high': 1.0,
'eps': 1e-06
}
ARGS = {
'clip': 0.5,
'sample_shape': torch.Size([2, 3])
}
METHOD = 'sample'
if __name__ == '__main__':
dist = TruncatedNormal(**INIT_ARGS)
result = dist.sample(**ARGS)
print(f"Result shape: {result.shape}")
print(f"Result: {result}")
- 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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| schedule |
Ran ran, honoured the contract we drafted |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("53f6373e323067d0") 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 float64, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import numpy as np
import re
def schedule(schdl, step) -> float:
try:
return float(schdl)
except ValueError:
match = re.match('linear\\((.+),(.+),(.+)\\)', schdl)
if match:
init, final, duration = [float(g) for g in match.groups()]
mix = np.clip(step / duration, 0.0, 1.0)
return (1.0 - mix) * init + mix * final
match = re.match('step_linear\\((.+),(.+),(.+),(.+),(.+)\\)', schdl)
if match:
init, final1, duration1, final2, duration2 = [float(g) for g in match.groups()]
if step <= duration1:
mix = np.clip(step / duration1, 0.0, 1.0)
return (1.0 - mix) * init + mix * final1
else:
mix = np.clip((step - duration1) / duration2, 0.0, 1.0)
return (1.0 - mix) * final1 + mix * final2
ARGS = {
"schdl": "linear(0.1,0.01,100)",
"step": 50
}
- 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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
- 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
|
| AbstractAgent |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("5c45e7cf6e639135") How it ran |
| AbstractMLP |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("0952e55bb0dcf25c") How it ran |
| ActorModel |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("aa653345ad8ad268") How it ran |
| Batch |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("b940ca501e37511f") How it ran |
| CFB |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("c28fc24e49523491") How it ran |
| FB |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("d2fc051560d214e9") How it ran |
| ForwardBackwardRepresentation |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("64523b02a6612ce0") How it ran |
| ForwardRepresentation |
Not yet run unverified (harvested, no recorded run) |
enjeeneer/conservative-world-models/agents/cfb/agent.py code served (permissive licence) · get_code("2b3a474296d0ab6a") How it ran |