| ArraySpec |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("8178c2d555c68f4b") 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, ArraySpec: 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
from typing import Tuple
torch.manual_seed(0)
@dataclass(frozen=True)
class ArraySpec:
shape: Tuple[int, ...]
ARGS = {
"shape": (4, 3, 2)
}
- 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 ArraySpec — 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 ArraySpec 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
|
| ChannelDropout |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("ca1d055a4db1e6d9") 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, ChannelDropout: 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 einops import rearrange
torch.manual_seed(0)
# ChannelDropout only takes one parameter: dropout
# It's a float representing the dropout probability
ARGS = {
"dropout": 0.5
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ChannelDropout — 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 ChannelDropout 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
|
| ChannelLayerNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("a878a9a8b0f2ab3e") 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, ChannelLayerNorm: 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 torch import nn
from einops.layers.torch import Rearrange
torch.manual_seed(0)
class ChannelLayerNorm(nn.Module):
def __init__(self, channels, eps=1e-05):
super().__init__()
self.eps = eps
self.gamma = nn.Parameter(torch.ones(channels))
self.beta = nn.Parameter(torch.zeros(channels))
self.channels_last = Rearrange('b c ... -> b ... c')
self.channels_first = Rearrange('b ... c -> b c ...')
def forward(self, x):
x = self.channels_last(x)
mean = x.mean(dim=-1, keepdim=True)
std = x.std(dim=-1, keepdim=True)
x = (x - mean) / (std + self.eps)
out = self.channels_first(x * self.gamma + self.beta)
return out
ARGS = {
'channels': 4,
'eps': 1e-05
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ChannelLayerNorm — 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 ChannelLayerNorm 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
|
| ChannelLinear |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("40353a86c31fca90") 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, ChannelLinear: 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 einops.layers.torch import Rearrange
torch.manual_seed(0)
ARGS = {
"in_channels": 4,
"out_channels": 3,
"bias": True,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ChannelLinear — 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 ChannelLinear 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
|
| EinsumLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("c2e173b5a7b62641") 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, EinsumLayer: 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 torch import nn
torch.manual_seed(0)
# Define ARGS dict with all parameters for EinsumLayer
ARGS = {
"equation": "ij,jk->ik",
"weight_shape": [4, 3],
"fan_in_mask": [1.0, 0.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 EinsumLayer — 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 EinsumLayer 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
|
| GaussianFourierFeatureTransform |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("48fe3dea36f9c89e") 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, GaussianFourierFeatureTransform: 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 torch import nn
import math
import collections
torch.manual_seed(0)
class WeightSpaceFeatures(collections.abc.Sequence):
def __init__(self, weights, biases):
if isinstance(weights, list):
weights = tuple(weights)
if isinstance(biases, list):
biases = tuple(biases)
self.weights = weights
self.biases = biases
def __len__(self):
return len(self.weights)
def __iter__(self):
return zip(self.weights, self.biases)
def __getitem__(self, idx):
return (self.weights[idx], self.biases[idx])
def __add__(self, other):
out_weights = tuple((w1 + w2 for w1, w2 in zip(self.weights, other.weights)))
out_biases = tuple((b1 + b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(out_weights, out_biases)
def __mul__(self, other):
if isinstance(other, WeightSpaceFeatures):
weights = tuple((w1 * w2 for w1, w2 in zip(self.weights, other.weights)))
biases = tuple((b1 * b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(weights, biases)
return self.map(lambda x: x * other)
def detach(self):
"""Returns a copy with detached tensors."""
return WeightSpaceFeatures(tuple((w.detach() for w in self.weights)), tuple((b.detach() for b in self.biases)))
def map(self, func):
"""Applies func to each weight and bias tensor."""
return WeightSpaceFeatures(tuple((func(w) for w in self.weights)), tuple((func(b) for b in self.biases)))
def to(self, device):
"""Moves all tensors to device."""
return WeightSpaceFeatures(tuple((w.to(device, non_blocking=True) for w in self.weights)), tuple((b.to(device, non_blocking=True) for b in self.biases)))
@classmethod
def from_zipped(cls, weight_and_biases):
"""Converts a list of (weights, biases) into a WeightSpaceFeatures object."""
weights, biases = zip(*weight_and_biases)
return cls(weights, biases)
class GaussianFourierFeatureTransform(nn.Module):
"""
Given an input of size [batches, num_input_channels, ...],
returns a tensor of size [batches, mapping_size*2, ...].
"""
def __init__(self, network_spec, in_channels, mapping_size=256, scale=10):
super().__init__()
self.network_spec = network_spec
self.in_channels = in_channels
self._mapping_size = mapping_size
self.out_channels = mapping_size * 2
self.scale = scale
self.register_buffer('_B', torch.randn((in_channels, mapping_size)) * scale)
def encode_tensor(self, x):
x = (x.transpose(1, -1) @ self._B).transpose(1, -1)
x = 2 * math.pi * x
return torch.cat([torch.sin(x), torch.cos(x)], dim=1)
def forward(self, wsfeat):
out_weights, out_biases = ([], [])
for i in range(len(self.network_spec)):
weight, bias = wsfeat[i]
out_weights.append(self.encode_tensor(weight))
out_biases.append(self.encode_tensor(bias))
return WeightSpaceFeatures(out_weights, out_biases)
def __repr__(self):
return f'GaussianFourierFeatureTransform(in_channels={self.in_channels}, mapping_size={self._mapping_size}, scale={self.scale})'
# Create test data
network_spec = [0, 1, 2] # 3 layers
in_channels = 4
mapping_size = 8
scale = 10.0
# Create weight and bias tensors for each layer
# Each weight has shape [out_dim, in_channels] to work with encode_tensor
weights = [
torch.randn(3, in_channels),
torch.randn(5, in_channels),
torch.randn(2, in_channels)
]
biases = [
torch.randn(3, in_channels),
torch.randn(5, in_channels),
torch.randn(2, in_channels)
]
wsfeat = WeightSpaceFeatures(weights, biases)
ARGS = {
'network_spec': network_spec,
'in_channels': in_channels,
'mapping_size': mapping_size,
'scale': scale
}
- 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 GaussianFourierFeatureTransform — 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 GaussianFourierFeatureTransform 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
|
| IOSinusoidalEncoding |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("26be31658f5e058b") 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, IOSinusoidalEncoding: 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 torch import nn
import math
from dataclasses import dataclass
from typing import List, Tuple
torch.manual_seed(0)
@dataclass(frozen=True)
class ArraySpec:
shape: Tuple[int, ...]
@dataclass(frozen=True)
class NetworkSpec:
weight_spec: List[ArraySpec]
bias_spec: List[ArraySpec]
layer_in_weight_shape: ArraySpec
layer_out_weight_shape: ArraySpec
def get_io(self):
return (self.weight_spec[0].shape[1], self.weight_spec[-1].shape[0])
def get_io_matrices_shape(self):
return (self.layer_in_weight_shape, self.layer_out_weight_shape)
def get_num_params(self):
num_params = 0
for w, b in zip(self.weight_spec, self.bias_spec):
num_weights = 1
for dim in w.shape:
assert dim != -1
num_weights *= dim
num_biases = 1
for dim in b.shape:
assert dim != -1
num_biases *= dim
num_params += num_weights + num_biases
return num_params
def __len__(self):
return len(self.weight_spec)
class WeightSpaceFeatures:
def __init__(self, weights, biases):
if isinstance(weights, list):
weights = tuple(weights)
if isinstance(biases, list):
biases = tuple(biases)
self.weights = weights
self.biases = biases
def __len__(self):
return len(self.weights)
def __iter__(self):
return zip(self.weights, self.biases)
def __getitem__(self, idx):
return (self.weights[idx], self.biases[idx])
# Create a minimal NetworkSpec
# 2 layers: layer 0 has shape (4, 3), layer 1 has shape (3, 2)
weight_specs = [
ArraySpec(shape=(4, 3)),
ArraySpec(shape=(3, 2))
]
bias_specs = [
ArraySpec(shape=(4,)),
ArraySpec(shape=(3,))
]
layer_in_weight_shape = ArraySpec(shape=(4, 3))
layer_out_weight_shape = ArraySpec(shape=(3, 2))
network_spec = NetworkSpec(
weight_spec=weight_specs,
bias_spec=bias_specs,
layer_in_weight_shape=layer_in_weight_shape,
layer_out_weight_shape=layer_out_weight_shape
)
# Create WeightSpaceFeatures with matching shapes
weights = [
torch.randn(2, 4, 3),
torch.randn(2, 3, 2)
]
biases = [
torch.randn(2, 4),
torch.randn(2, 3)
]
wsfeat = WeightSpaceFeatures(weights, biases)
ARGS = {
"network_spec": network_spec,
"max_freq": 10,
"num_bands": 6,
"enc_layers": 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 IOSinusoidalEncoding — 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 IOSinusoidalEncoding 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
|
| NetworkSpec |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("470213dfc5111c7e") 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, NetworkSpec: 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.
from dataclasses import dataclass
from typing import Tuple, List
@dataclass(frozen=True)
class ArraySpec:
shape: Tuple[int, ...]
# Create weight and bias specs for a simple 2-layer network
# Layer 1: input_dim=5, hidden_dim=3
# Layer 2: hidden_dim=3, output_dim=2
weight_spec = [
ArraySpec(shape=(3, 5)), # First layer: 3 neurons, 5 inputs
ArraySpec(shape=(2, 3)), # Second layer: 2 neurons, 3 inputs
]
bias_spec = [
ArraySpec(shape=(3,)), # First layer bias
ArraySpec(shape=(2,)), # Second layer bias
]
layer_in_weight_shape = ArraySpec(shape=(5, 4)) # Input layer transformation
layer_out_weight_shape = ArraySpec(shape=(2, 6)) # Output layer transformation
ARGS = {
"weight_spec": weight_spec,
"bias_spec": bias_spec,
"layer_in_weight_shape": layer_in_weight_shape,
"layer_out_weight_shape": layer_out_weight_shape,
}
- 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 NetworkSpec — 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 NetworkSpec 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
|
| NormalizingModule |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("1db75947d6ce1f3b") 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, NormalizingModule: 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)
# Create a simple WeightSpaceFeatures object with sample tensors
weights = [
torch.randn(4, 3),
torch.randn(5, 4)
]
biases = [
torch.randn(3),
torch.randn(4)
]
# Create mean/std stats for normalization
weight_stats = [
(torch.randn(4, 3), torch.randn(4, 3).abs() + 0.1),
(torch.randn(5, 4), torch.randn(5, 4).abs() + 0.1)
]
bias_stats = [
(torch.randn(3), torch.randn(3).abs() + 0.1),
(torch.randn(4), torch.randn(4).abs() + 0.1)
]
mean_std_stats = (weight_stats, bias_stats)
ARGS = {
'normalize': 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 NormalizingModule — 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 NormalizingModule 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
|
| ParamLayerNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("dddb1bf40099aca9") 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, ParamLayerNorm: 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 dataclasses import dataclass
from typing import List, Tuple
torch.manual_seed(0)
@dataclass(frozen=True)
class ArraySpec:
shape: Tuple[int, ...]
@dataclass(frozen=True)
class NetworkSpec:
weight_spec: List[ArraySpec]
bias_spec: List[ArraySpec]
layer_in_weight_shape: ArraySpec
layer_out_weight_shape: ArraySpec
def get_io(self):
return (self.weight_spec[0].shape[1], self.weight_spec[-1].shape[0])
def get_io_matrices_shape(self):
return (self.layer_in_weight_shape, self.layer_out_weight_shape)
def get_num_params(self):
num_params = 0
for w, b in zip(self.weight_spec, self.bias_spec):
num_weights = 1
for dim in w.shape:
assert dim != -1
num_weights *= dim
num_biases = 1
for dim in b.shape:
assert dim != -1
num_biases *= dim
num_params += num_weights + num_biases
return num_params
def __len__(self):
return len(self.weight_spec)
network_spec = NetworkSpec(
weight_spec=[
ArraySpec(shape=(4, 3)),
ArraySpec(shape=(5, 4)),
ArraySpec(shape=(6, 5))
],
bias_spec=[
ArraySpec(shape=(4,)),
ArraySpec(shape=(5,)),
ArraySpec(shape=(6,))
],
layer_in_weight_shape=ArraySpec(shape=(3, 3)),
layer_out_weight_shape=ArraySpec(shape=(6, 6))
)
channels = 8
ARGS = {
"network_spec": network_spec,
"channels": channels
}
- 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 ParamLayerNorm — 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 ParamLayerNorm 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
|
| Pointwise |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("f6a29acf17a126b8") 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, Pointwise: 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
from dataclasses import dataclass
from typing import List, Tuple
torch.manual_seed(0)
@dataclass(frozen=True)
class ArraySpec:
shape: Tuple[int, ...]
# Create a NetworkSpec with reasonable dimensions
# Let's say we have 2 layers in the network
# Layer 1: (batch=2, in_channels=4, out_channels=5, h=3, w=3) -> shape (2, 4, 5, 6, 3, 3)
# Layer 2: (batch=2, in_channels=5, out_channels=7) -> shape (2, 5, 7)
weight_spec = [
ArraySpec(shape=(2, 4, 5, 6, 3, 3)), # Conv layer: (batch, in_channels, out_channels, kernel_in, h, w)
ArraySpec(shape=(2, 5, 7)), # Linear layer: (batch, in_features, out_features)
]
bias_spec = [
ArraySpec(shape=(2, 5)), # Bias for layer 1
ArraySpec(shape=(2, 7)), # Bias for layer 2
]
layer_in_weight_shape = ArraySpec(shape=(2, 6, 5, 4))
layer_out_weight_shape = ArraySpec(shape=(2, 7, 5, 4))
network_spec = type('NetworkSpec', (), {
'weight_spec': weight_spec,
'bias_spec': bias_spec,
'layer_in_weight_shape': layer_in_weight_shape,
'layer_out_weight_shape': layer_out_weight_shape,
'get_io': lambda self: (6, 7),
'get_io_matrices_shape': lambda self: (layer_in_weight_shape, layer_out_weight_shape),
'get_num_params': lambda self: sum(
np.prod(w.shape) + np.prod(b.shape)
for w, b in zip(self.weight_spec, self.bias_spec)
),
'__len__': lambda self: len(self.weight_spec),
})()
in_channels = 3
out_channels = 4
ARGS = {
'network_spec': network_spec,
'in_channels': in_channels,
'out_channels': out_channels,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Pointwise — 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 Pointwise 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
|
| SimpleLayerNorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("0b69c6dba62cba08") 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, SimpleLayerNorm: 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 einops.layers.torch import Rearrange
import numpy as np
torch.manual_seed(0)
# Create a minimal network_spec object that satisfies the usage in SimpleLayerNorm
class WeightSpec:
def __init__(self, shape):
self.shape = shape
class NetworkSpec:
def __init__(self, weight_specs):
self.weight_spec = weight_specs
def __len__(self):
return len(self.weight_spec)
# Build weight_spec for different layer types
# For a 2D weight (linear layer): shape = (out, in)
# For a 4D weight (conv layer): shape = (out, in, h, w)
weight_spec_1 = WeightSpec((5, 3)) # Linear layer: out=5, in=3
weight_spec_2 = WeightSpec((7, 4, 3, 3)) # Conv layer: out=7, in=4, h=3, w=3
network_spec = NetworkSpec([weight_spec_1, weight_spec_2])
# Set channels
channels = 4
ARGS = {
"network_spec": network_spec,
"channels": channels,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type SimpleLayerNorm — 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 SimpleLayerNorm 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
|
| TupleOp |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("ce83a7db6de57bec") 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, TupleOp: 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 collections
torch.manual_seed(0)
class WeightSpaceFeatures(collections.abc.Sequence):
def __init__(self, weights, biases):
if isinstance(weights, list):
weights = tuple(weights)
if isinstance(biases, list):
biases = tuple(biases)
self.weights = weights
self.biases = biases
def __len__(self):
return len(self.weights)
def __iter__(self):
return zip(self.weights, self.biases)
def __getitem__(self, idx):
return (self.weights[idx], self.biases[idx])
def __add__(self, other):
out_weights = tuple((w1 + w2 for w1, w2 in zip(self.weights, other.weights)))
out_biases = tuple((b1 + b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(out_weights, out_biases)
def __mul__(self, other):
if isinstance(other, WeightSpaceFeatures):
weights = tuple((w1 * w2 for w1, w2 in zip(self.weights, other.weights)))
biases = tuple((b1 * b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(weights, biases)
return self.map(lambda x: x * other)
def detach(self):
"""Returns a copy with detached tensors."""
return WeightSpaceFeatures(tuple((w.detach() for w in self.weights)), tuple((b.detach() for b in self.biases)))
def map(self, func):
"""Applies func to each weight and bias tensor."""
return WeightSpaceFeatures(tuple((func(w) for w in self.weights)), tuple((func(b) for b in self.biases)))
def to(self, device):
"""Moves all tensors to device."""
return WeightSpaceFeatures(tuple((w.to(device, non_blocking=True) for w in self.weights)), tuple((b.to(device, non_blocking=True) for b in self.biases)))
@classmethod
def from_zipped(cls, weight_and_biases):
"""Converts a list of (weights, biases) into a WeightSpaceFeatures object."""
weights, biases = zip(*weight_and_biases)
return cls(weights, biases)
class TupleOp(nn.Module):
def __init__(self, op):
super().__init__()
self.op = op
def forward(self, wsfeat: WeightSpaceFeatures) -> WeightSpaceFeatures:
out_weights = [self.op(w) for w in wsfeat.weights]
out_bias = [self.op(b) for b in wsfeat.biases]
return WeightSpaceFeatures(out_weights, out_bias)
def __repr__(self):
return f'TupleOp({self.op})'
# Create sample tensors
weight_1 = torch.randn(4, 3)
weight_2 = torch.randn(5, 4)
bias_1 = torch.randn(3)
bias_2 = torch.randn(4)
weights = [weight_1, weight_2]
biases = [bias_1, bias_2]
# Create a simple operation (e.g., ReLU)
op = nn.ReLU()
ARGS = {
"op": op
}
- 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 TupleOp — 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 TupleOp 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
|
| WeightSpaceFeatures |
Ran ran on a synthesized input · constructed an object; no result was computed |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("13dc87e6610b8b4e") 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, WeightSpaceFeatures: 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 collections
torch.manual_seed(0)
# Create small tensors for weights and biases
# Use distinct sizes: weights are 4x3, biases are 3
weights = (
torch.randn(4, 3),
torch.randn(3, 2),
torch.randn(2, 5)
)
biases = (
torch.randn(3),
torch.randn(2),
torch.randn(5)
)
ARGS = {
"weights": weights,
"biases": biases
}
- 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 WeightSpaceFeatures — the run constructed an instance of its own class and did not call it; no shape 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
|
| compute_mean_std |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/experiments/data_utils.py code served (permissive licence) · get_code("9870adcdf1003523") 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 torch
torch.manual_seed(0)
# Create a loader that yields (params, *_) tuples
# params should be a tuple of (weights, bias)
# weights and bias are lists of tensors
loader = []
for batch_idx in range(3):
# Create sample weights (list of tensors with different shapes)
weights = [
torch.randn(2, 4), # batch_size=2, feature_dim=4
torch.randn(2, 3), # batch_size=2, feature_dim=3
]
# Create sample biases (list of tensors with different shapes)
bias = [
torch.randn(2, 5), # batch_size=2, feature_dim=5
torch.randn(2, 2), # batch_size=2, feature_dim=2
]
# Each item in loader is (params, *_)
# params is a tuple of (weights, bias)
params = (weights, bias)
loader.append((params,))
ARGS = {
"loader": loader,
"max_batches": 2,
}
- 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 — 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
|
| fourier_encode |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/nfn/layers/encoding.py code served (permissive licence) · get_code("260b648862af987e") 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 Tensor, ndim 3, dtype family float, shape (2, 4, 9) 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
torch.manual_seed(0)
# Create a small tensor input
# The function expects x to be a tensor that can be unsqueezed
# Shape: (batch_size, feature_dim) = (2, 4)
x = torch.randn(2, 4)
# max_freq parameter - a scalar value
max_freq = 10.0
# num_bands parameter - number of frequency bands
num_bands = 4
ARGS = {
"x": x,
"max_freq": max_freq,
"num_bands": num_bands,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- 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, 4, 9) — shape (2, 4, 9) 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
|
| fourier_encode |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("5febbdfeec3c83ff") 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 3, dtype family float, shape (2, 4, 9) 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
torch.manual_seed(0)
# The function takes:
# - x: a tensor that will be unsqueezed and used in arithmetic operations
# - max_freq: a scalar controlling the frequency range
# - num_bands: number of frequency bands (default 4)
# Create a small input tensor
# Shape: (batch_size, feature_dim) = (2, 4)
x = torch.randn(2, 4)
# max_freq: a scalar value controlling maximum frequency
max_freq = 10.0
# num_bands: number of frequency bands
num_bands = 4
ARGS = {
"x": x,
"max_freq": max_freq,
"num_bands": num_bands,
}
- 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 3, dtype family float, shape (2, 4, 9) — shape (2, 4, 9) 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_npy_from_state_dict |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/experiments/data_utils.py code served (permissive licence) · get_code("b6b09a11976ae372") 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 torch
from collections import OrderedDict
import torch.nn as nn
torch.manual_seed(0)
# Create a small neural network to extract state_dict from
model = nn.Sequential(
nn.Linear(4, 3),
nn.ReLU(),
nn.Linear(3, 2)
)
# Get the state_dict from the model
state_dict = model.state_dict()
# Convert to OrderedDict with tensor values on CPU
ordered_state = OrderedDict()
for key, value in state_dict.items():
ordered_state[key] = value.cpu()
ARGS = {
'state_dict': ordered_state
}
- 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 — 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_state_dict_from_npy |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/experiments/data_utils.py code served (permissive licence) · get_code("6b2124e8e2fb9a33") 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 OrderedDict. 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 torch
import torch.nn as nn
from collections import OrderedDict
torch.manual_seed(0)
# Create a small CNN with a few layers
cnn = nn.Sequential(
nn.Conv2d(3, 8, kernel_size=3),
nn.ReLU(),
nn.Conv2d(8, 16, kernel_size=3),
nn.Flatten(),
nn.Linear(16 * 5 * 5, 10)
)
# Get the state dict to understand structure
state_dict_org = cnn.state_dict()
# Create weight and bias lists matching the structure
weight = []
bias = []
for key in state_dict_org.keys():
if 'weight' in key:
weight.append(np.random.randn(*state_dict_org[key].shape).astype(np.float32))
elif 'bias' in key:
bias.append(np.random.randn(*state_dict_org[key].shape).astype(np.float32))
ARGS = {
'cnn': cnn,
'weight': weight,
'bias': bias
}
- 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 OrderedDict — a OrderedDict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OrderedDict 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
|
| params_to_state_dicts |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/nfn/common/data.py code served (permissive licence) · get_code("ef49a788da8dde77") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import collections
from collections import OrderedDict
torch.manual_seed(0)
# Create WeightSpaceFeatures with small tensors
# batch_size = 2, feature_dim = 1 (as required by the function)
# We need weights and biases for multiple layers
weights = [
torch.randn(2, 1, 4), # batch_size=2, dim=1, feature_size=4
torch.randn(2, 1, 3), # batch_size=2, dim=1, feature_size=3
]
biases = [
torch.randn(2, 4), # batch_size=2, feature_size=4
torch.randn(2, 3), # batch_size=2, feature_size=3
]
wsfeat = type('WeightSpaceFeatures', (), {
'weights': tuple(weights),
'biases': tuple(biases)
})()
# Create keys for state dict
# Pattern is [0.weight, 0.bias, 1.weight, 1.bias, ...]
keys = [
'0.weight',
'0.bias',
'1.weight',
'1.bias',
]
ARGS = {
'keys': keys,
'wsfeat': wsfeat,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| shape_wsfeat_symmetry |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("c0a8a100ad21973a") 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 WeightSpaceFeatures. 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 collections
torch.manual_seed(0)
class WeightSpaceFeatures(collections.abc.Sequence):
def __init__(self, weights, biases):
if isinstance(weights, list):
weights = tuple(weights)
if isinstance(biases, list):
biases = tuple(biases)
self.weights = weights
self.biases = biases
def __len__(self):
return len(self.weights)
def __iter__(self):
return zip(self.weights, self.biases)
def __getitem__(self, idx):
return (self.weights[idx], self.biases[idx])
def __add__(self, other):
out_weights = tuple((w1 + w2 for w1, w2 in zip(self.weights, other.weights)))
out_biases = tuple((b1 + b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(out_weights, out_biases)
def __mul__(self, other):
if isinstance(other, WeightSpaceFeatures):
weights = tuple((w1 * w2 for w1, w2 in zip(self.weights, other.weights)))
biases = tuple((b1 * b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(weights, biases)
return self.map(lambda x: x * other)
def detach(self):
"""Returns a copy with detached tensors."""
return WeightSpaceFeatures(tuple((w.detach() for w in self.weights)), tuple((b.detach() for b in self.biases)))
def map(self, func):
"""Applies func to each weight and bias tensor."""
return WeightSpaceFeatures(tuple((func(w) for w in self.weights)), tuple((func(b) for b in self.biases)))
def to(self, device):
"""Moves all tensors to device."""
return WeightSpaceFeatures(tuple((w.to(device, non_blocking=True) for w in self.weights)), tuple((b.to(device, non_blocking=True) for b in self.biases)))
@classmethod
def from_zipped(cls, weight_and_biases):
"""Converts a list of (weights, biases) into a WeightSpaceFeatures object."""
weights, biases = zip(*weight_and_biases)
return cls(weights, biases)
class WeightSpec:
def __init__(self, shape):
self.shape = shape
class NetworkSpec:
def __init__(self, weight_spec):
self.weight_spec = weight_spec
# Create simple tensors for testing
# Two weight tensors: one 2D (linear), one 6D (conv)
weight_2d = torch.randn(2, 4) # batch=2, features=4
weight_6d = torch.randn(2, 3, 5, 4, 2, 2) # b=2, c=3, o=5, i=4, h=2, w=2
# Corresponding biases
bias_2d = torch.randn(4)
bias_6d = torch.randn(5)
# Create WeightSpaceFeatures object
params = WeightSpaceFeatures(
weights=[weight_2d, weight_6d],
biases=[bias_2d, bias_6d]
)
# Create NetworkSpec with weight specs
network_spec = NetworkSpec(
weight_spec=[
WeightSpec(shape=(2, 4)), # 2D shape
WeightSpec(shape=(2, 3, 5, 4, 2, 2)) # 6D shape
]
)
ARGS = {
"params": params,
"network_spec": network_spec
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type WeightSpaceFeatures — a WeightSpaceFeatures 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
|
| simple_attention |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("1fd171846ef2ef36") 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 3, dtype family float, shape (2, 3, 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 torch
import torch.nn as nn
import math
torch.manual_seed(0)
# Create tiny tensors for q, k, v
# q: (batch=2, seq_len=3, dim=4)
# k: (batch=2, seq_len=5, dim=4)
# v: (batch=2, seq_len=5, dim=6)
q = torch.randn(2, 3, 4)
k = torch.randn(2, 5, 4)
v = torch.randn(2, 5, 6)
# Create a dropout layer
# The function calls dropout(attn) where attn has shape (2, 3, 5)
dropout = nn.Dropout(p=0.1)
ARGS = {
"q": q,
"k": k,
"v": v,
"dropout": dropout
}
- 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 3, dtype family float, shape (2, 3, 6) — shape (2, 3, 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
|
| simple_attention |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/nfn/layers/layers.py code served (permissive licence) · get_code("dafd3ba91930d52f") 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 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 math
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create small tensors for query, key, value
# q shape: (batch=2, seq_len=3, dim=4)
# k shape: (batch=2, seq_len=3, dim=4)
# v shape: (batch=2, seq_len=3, dim=4)
q = torch.randn(2, 3, 4)
k = torch.randn(2, 3, 4)
v = torch.randn(2, 3, 4)
# Create a dropout layer that is callable
dropout_layer = nn.Dropout(p=0.1)
ARGS = {
"q": q,
"k": k,
"v": v,
"dropout": dropout_layer
}
- 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 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: none by the harness; any seed is in the setup block
|
| state_dict_to_tensors |
Ran ran; our contract draft was wrong, not the code |
MathematicalAI-NUS/Monomial-NFN/nfn/common/data.py code served (permissive licence) · get_code("d127d7b6cd98eaf2") 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 torch
import torch.nn as nn
torch.manual_seed(0)
# Create a state_dict with weight and bias pairs
# The function expects keys in order: [0.weight, 0.bias, 1.weight, 1.bias, ...]
state_dict = {
'0.weight': torch.randn(4, 3),
'0.bias': torch.randn(4),
'1.weight': torch.randn(5, 4),
'1.bias': torch.randn(5),
}
ARGS = {
'state_dict': state_dict,
}
- 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 — 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
|
| train_step |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/experiments/classify_siren.py code served (permissive licence) · get_code("baf32f15bff306f8") 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. 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
import torch.optim as optim
torch.manual_seed(0)
# Build a minimal NFNet-like model that accepts params and outputs logits
class MinimalNFNet(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 5) # 5 output classes for cross_entropy
def forward(self, x):
return self.linear(x)
# Create instances
nfnet = MinimalNFNet()
opt = optim.SGD(nfnet.parameters(), lr=0.01)
# params: a small batch of input tensors (batch_size=2, features=4)
params = torch.randn(2, 4)
# label: class indices for cross_entropy (batch_size=2, values in [0, 4])
label = torch.tensor([0, 2])
ARGS = {
"nfnet": nfnet,
"opt": opt,
"params": params,
"label": label,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- Imports
- torch — 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
|
| unshape_wsfeat_symmetry |
Ran ran; our contract draft was wrong, not the code |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("9fb54e896d3ed074") 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 WeightSpaceFeatures. 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 collections
torch.manual_seed(0)
class WeightSpaceFeatures(collections.abc.Sequence):
def __init__(self, weights, biases):
if isinstance(weights, list):
weights = tuple(weights)
if isinstance(biases, list):
biases = tuple(biases)
self.weights = weights
self.biases = biases
def __len__(self):
return len(self.weights)
def __iter__(self):
return zip(self.weights, self.biases)
def __getitem__(self, idx):
return (self.weights[idx], self.biases[idx])
def __add__(self, other):
out_weights = tuple((w1 + w2 for w1, w2 in zip(self.weights, other.weights)))
out_biases = tuple((b1 + b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(out_weights, out_biases)
def __mul__(self, other):
if isinstance(other, WeightSpaceFeatures):
weights = tuple((w1 * w2 for w1, w2 in zip(self.weights, other.weights)))
biases = tuple((b1 * b2 for b1, b2 in zip(self.biases, other.biases)))
return WeightSpaceFeatures(weights, biases)
return self.map(lambda x: x * other)
def detach(self):
"""Returns a copy with detached tensors."""
return WeightSpaceFeatures(tuple((w.detach() for w in self.weights)), tuple((b.detach() for b in self.biases)))
def map(self, func):
"""Applies func to each weight and bias tensor."""
return WeightSpaceFeatures(tuple((func(w) for w in self.weights)), tuple((func(b) for b in self.biases)))
def to(self, device):
"""Moves all tensors to device."""
return WeightSpaceFeatures(tuple((w.to(device, non_blocking=True) for w in self.weights)), tuple((b.to(device, non_blocking=True) for b in self.biases)))
@classmethod
def from_zipped(cls, weight_and_biases):
"""Converts a list of (weights, biases) into a WeightSpaceFeatures object."""
weights, biases = zip(*weight_and_biases)
return cls(weights, biases)
class WeightSpec:
def __init__(self, shape):
self.shape = shape
class NetworkSpec:
def __init__(self, weight_spec):
self.weight_spec = weight_spec
# Create test data
# Layer 1: 2D weight (linear layer)
weight_1 = torch.randn(2, 4)
bias_1 = torch.randn(2)
# Layer 2: 4D weight (conv layer) - shape (batch, out_channels, in_channels, h, w)
# We need to provide it reshaped as (batch, c*h*w, o, i) for the function to process
weight_2_reshaped = torch.randn(2, 12, 4, 3) # batch, c*h*w, o, i
bias_2 = torch.randn(4)
# Create WeightSpaceFeatures
params = WeightSpaceFeatures(
weights=[weight_1, weight_2_reshaped],
biases=[bias_1, bias_2]
)
# Create network spec with weight specs
# Layer 1 is 2D (linear): shape is (out, in)
weight_spec_1 = WeightSpec(shape=(2, 4))
# Layer 2 is 4D (conv): shape is (out_channels, in_channels, h, w)
weight_spec_2 = WeightSpec(shape=(4, 3, 2, 2))
network_spec = NetworkSpec(
weight_spec=[weight_spec_1, weight_spec_2]
)
ARGS = {
"params": params,
"network_spec": network_spec
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type WeightSpaceFeatures — a WeightSpaceFeatures 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
|
| HNPLinear |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("29a32995bc174d5a") How it ran |
| HNPSLinear |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("c121ad9422f9a2f9") How it ran |
| HNPS_SirenLinear |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("5ba93c4071e28b32") How it ran |
| InvariantNFN_HNPS |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("3cf245773e40b81d") How it ran |
| NPAttention |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("247366d488114b00") How it ran |
| NPLinear |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("32c44311b1642ecb") How it ran |
| StatFeaturizer |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("e868a1e2f9647f67") How it ran |
| network_spec_from_wsfeat |
Not yet run unverified (harvested, no recorded run) |
MathematicalAI-NUS/Monomial-NFN/nfn/common/data.py code served (permissive licence) · get_code("bb77e575f8866574") How it ran |
| set_init_ |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("3e3e39920e776702") How it ran |
| set_init_einsum_ |
Not yet run unverified (harvested, no recorded run) |
mathematicalai-nus/monomial-nfn/experiments/models.py code served (permissive licence) · get_code("8433cbb2dd1ac57c") How it ran |