| ClassificationHead |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("c1c9437626597115") 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, ClassificationHead: 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)
# Create a small input tensor matching the expected shape
# [batch_size x n_channels x n_patches x d_model]
batch_size = 2
n_channels = 1
n_patches = 3
d_model = 768
x = torch.randn(batch_size, n_channels, n_patches, d_model)
ARGS = {
"n_channels": 1,
"d_model": 768,
"n_classes": 2,
"head_dropout": 0.1,
}
- 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 ClassificationHead — 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 ClassificationHead 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
|
| ClassificationHead |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("8ef9dc7505c942b4") 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, ClassificationHead: 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)
ARGS = {
'n_channels': 2,
'd_model': 768,
'n_classes': 3,
'head_dropout': 0.1,
'reduction': 'concat'
}
- 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 ClassificationHead — 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 ClassificationHead 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
|
| ForecastingHead |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("1ebce6b5c9313e8a") 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, ForecastingHead: 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)
# The ForecastingHead forward method expects:
# x: [batch_size x n_channels x n_patches x d_model]
# It flattens the last two dimensions, applies linear layer with head_nf input features,
# then applies dropout
# Create a minimal valid input tensor
# batch_size=2, n_channels=3, n_patches=4, d_model=5
# After flatten(start_dim=-2): [2, 3, 20] where 20 = 4*5
batch_size = 2
n_channels = 3
n_patches = 4
d_model = 5
x = torch.randn(batch_size, n_channels, n_patches, d_model)
# head_nf should match the flattened feature dimension
# After flatten: [batch_size, n_channels, n_patches * d_model]
# The linear layer takes input of size n_patches * d_model = 20
head_nf = n_patches * d_model # 20
forecast_horizon = 96
head_dropout = 0.1
# Optional input_mask (can be None, so we'll make a valid one)
input_mask = torch.ones(batch_size, n_channels, dtype=torch.bool)
ARGS = {
"head_nf": head_nf,
"forecast_horizon": forecast_horizon,
"head_dropout": head_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 ForecastingHead — 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 ForecastingHead 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
|
| ForecastingHead |
Ran ran on a synthesized input |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("5943c7631d9d3474") 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 numpy as np
# ForecastingHead expects input of shape (batch, ..., features) that will be flattened
# from start_dim=-2, then passed through a Linear(head_nf, forecast_horizon).
#
# If we have input shape (batch, seq_len, hidden_dim), flatten from -2 gives
# (batch, seq_len * hidden_dim), so head_nf = seq_len * hidden_dim.
batch_size = 2
seq_len = 8
hidden_dim = 6
forecast_horizon = 12
head_dropout = 0.1
# head_nf must equal the flattened size: seq_len * hidden_dim
head_nf = seq_len * hidden_dim
INIT_ARGS = {
'head_nf': head_nf,
'forecast_horizon': forecast_horizon,
'head_dropout': head_dropout
}
# Create input tensor with shape (batch_size, seq_len, hidden_dim)
x = torch.randn(batch_size, seq_len, hidden_dim)
# input_mask is optional
input_mask = torch.ones(batch_size, seq_len, dtype=torch.bool)
ARGS = {
'x': x,
'input_mask': input_mask
}
- 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 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)
|
| Masking |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("e8834f0cfa23f251") 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, Masking: 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
torch.manual_seed(0)
# Create sample tensors for testing
# For 4D input: [batch_size x n_channels x n_patches x patch_len]
x_4d = torch.randn(2, 3, 5, 8)
# For 3D input: [batch_size x n_channels x seq_len]
x_3d = torch.randn(2, 3, 40)
# Input mask: [batch_size x seq_len]
input_mask = torch.ones(2, 40)
input_mask[0, 20:] = 0 # Partially mask out some positions
ARGS = {
"mask_ratio": 0.3,
"patch_len": 8,
"stride": 8,
}
- 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 Masking — 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 Masking 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
|
| Masking |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("6d202f0efa0f3d3b") 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, Masking: 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
torch.manual_seed(0)
# Create a Masking instance to test
masking_instance = type('Masking', (), {
'mask_ratio': 0.3,
'patch_len': 8,
'stride': 8,
'convert_seq_to_patch_view': staticmethod(lambda mask, patch_len=8, stride=None: (mask.unfold(dimension=-1, size=patch_len, step=(patch_len if stride is None else stride)).sum(dim=-1) == patch_len).long()),
'convert_patch_to_seq_view': staticmethod(lambda mask, patch_len=8: mask.repeat_interleave(patch_len, dim=-1)),
})()
# Test tensors for generate_mask
x_seq = torch.randn(2, 3, 16) # [batch_size=2, n_channels=3, seq_len=16]
input_mask_seq = torch.ones(2, 16) # [batch_size=2, seq_len=16]
x_patch = torch.randn(2, 3, 2, 8) # [batch_size=2, n_channels=3, n_patches=2, patch_len=8]
input_mask_patch = torch.ones(2, 16) # [batch_size=2, seq_len=16]
ARGS = {
'mask_ratio': 0.3,
'patch_len': 8,
'stride': 8,
}
- 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 Masking — 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 Masking 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
|
| NamespaceWithDefaults |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("de1f59963de469c2") 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, NamespaceWithDefaults: 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 argparse import Namespace
torch.manual_seed(0)
# Create a simple source namespace with various attributes
source_namespace = Namespace(
learning_rate=0.001,
batch_size=32,
epochs=10,
model_name="test_model",
debug=False,
hidden_dim=128,
dropout=0.5,
seed=42
)
# The NamespaceWithDefaults class only takes one parameter in its classmethod:
# - from_namespace(cls, namespace)
# And the instance methods use:
# - getattr(self, key, default=None)
# For the ARGS dict, we need to provide arguments for instantiation.
# Looking at the class, __init__ is inherited from Namespace which takes **kwargs
# We can instantiate it directly with attributes, or use from_namespace
ARGS = {
'namespace': source_namespace
}
- 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 NamespaceWithDefaults — 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 NamespaceWithDefaults 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
|
| PatchEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("d34a07561490ed88") 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, PatchEmbedding: 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
torch.manual_seed(0)
# Build ARGS dict for PatchEmbedding.__init__
ARGS = {
'd_model': 768,
'seq_len': 512,
'patch_len': 8,
'stride': 8,
'dropout': 0.1,
'add_positional_embedding': False,
'value_embedding_bias': False,
'orth_gain': 1.41,
}
- 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 PatchEmbedding — 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 PatchEmbedding 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
|
| PatchEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("e53222338698c548") 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, PatchEmbedding: 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
torch.manual_seed(0)
ARGS = {
"d_model": 64,
"seq_len": 128,
"patch_len": 8,
"stride": 8,
"patch_dropout": 0.1,
"add_positional_embedding": False,
"value_embedding_bias": False,
"orth_gain": 1.41,
}
- 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 PatchEmbedding — 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 PatchEmbedding 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
|
| Patching |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("edadd0bc7dbe0ed1") 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, Patching: 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)
# Construct a small input tensor for the forward pass
# Shape: (batch=2, channels=3, time_steps=16)
# We need enough time steps to allow unfolding with patch_len and stride
x = torch.randn(2, 3, 16)
# Define parameters for Patching
patch_len = 4
stride = 4
ARGS = {
'patch_len': patch_len,
'stride': stride
}
- 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 Patching — 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 Patching 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
|
| Patching |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("2d07ad712507deb1") 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, Patching: 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 small input tensor for the forward pass
# Shape: (batch_size=2, channels=4, sequence_length=16)
# The sequence length needs to be large enough to apply unfold with patch_len and stride
x = torch.randn(2, 4, 16)
ARGS = {
'patch_len': 4,
'stride': 4,
}
- 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 Patching — 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 Patching 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
|
| PositionalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("9b8f485416c59a5e") 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, PositionalEmbedding: 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
torch.manual_seed(0)
# PositionalEmbedding is a standalone nn.Module, so we just need to construct
# valid arguments for its __init__ method and test forward pass
# The __init__ parameters are:
# - d_model: int (embedding dimension)
# - max_len: int (maximum sequence length, default 5000)
# - model_name: str (model identifier, default 'MOMENT')
# The forward method expects x to be a tensor where:
# - If model_name is 'MOMENT', 'TimesNet', or 'GPT4TS': x.size(2) is used
# - Otherwise: x.size(1) is used
# For testing, we'll create a small tensor that works with the forward pass
d_model = 4
max_len = 100
model_name = 'MOMENT'
# Create a test input tensor
# For MOMENT model, we use x.size(2), so we need at least 3 dimensions
# Shape: (batch_size=2, seq_len=3, d_model=4)
test_input = torch.randn(2, 3, 4)
ARGS = {
'd_model': 4,
'max_len': 100,
'model_name': 'MOMENT'
}
- 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 PositionalEmbedding — 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 PositionalEmbedding 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
|
| PretrainHead |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("852253d6801604d3") 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, PretrainHead: 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)
class PretrainHead(nn.Module):
def __init__(self, d_model: int=768, patch_len: int=8, head_dropout: float=0.1, orth_gain: float=1.41):
super().__init__()
self.dropout = nn.Dropout(head_dropout)
self.linear = nn.Linear(d_model, patch_len)
if orth_gain is not None:
torch.nn.init.orthogonal_(self.linear.weight, gain=orth_gain)
self.linear.bias.data.zero_()
def forward(self, x):
"""
x: [batch_size x n_channels x n_patches x d_model]
output: [batch_size x n_channels x seq_len], where seq_len = n_patches * patch_len
"""
x = self.linear(self.dropout(x))
x = x.flatten(start_dim=2, end_dim=3)
return x
ARGS = {
"d_model": 4,
"patch_len": 3,
"head_dropout": 0.1,
"orth_gain": 1.41,
}
- 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 PretrainHead — 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 PretrainHead 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
|
| PretrainHead |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("9245a921549e45e1") 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, PretrainHead: 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)
# The forward method expects:
# - x: a tensor that can be passed through nn.Linear(d_model, patch_len)
# - x should have shape compatible with flatten(start_dim=2, end_dim=3)
# This suggests x has at least 4 dimensions: (batch, ..., dim1, dim2)
# where the last dimension should be d_model
# Create a sample input tensor
# Shape: (batch=2, seq=3, height=4, width=5) where last dim will be d_model
batch_size = 2
seq_len = 3
height = 4
d_model = 768
x = torch.randn(batch_size, seq_len, height, d_model)
ARGS = {
"d_model": 768,
"patch_len": 8,
"head_dropout": 0.1,
"orth_gain": 1.41,
}
- 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 PretrainHead — 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 PretrainHead 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
|
| RevIN |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("62ae5753f3455e0a") 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, RevIN: 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)
def nanstd(tensor, dim=None, keepdim=False):
output = nanvar(tensor, dim=dim, keepdim=keepdim)
output = output.sqrt()
return output
def nanvar(tensor, dim=None, keepdim=False):
tensor_mean = tensor.nanmean(dim=dim, keepdim=True)
output = (tensor - tensor_mean).square().nanmean(dim=dim, keepdim=keepdim)
return output
class RevIN(nn.Module):
def __init__(self, num_features: int, eps: float=1e-05, affine: bool=False):
"""
:param num_features: the number of features or channels
:param eps: a value added for numerical stability
:param affine: if True, RevIN has learnable affine parameters
"""
super(RevIN, self).__init__()
self.num_features = num_features
self.eps = eps
self.affine = affine
if self.affine:
self._init_params()
def forward(self, x: torch.Tensor, mode: str='norm', mask: torch.Tensor=None):
"""
:param x: input tensor of shape (batch_size, n_channels, seq_len)
:param mode: 'norm' or 'denorm'
:param mask: input mask of shape (batch_size, seq_len)
:return: RevIN transformed tensor
"""
if mode == 'norm':
self._get_statistics(x, mask=mask)
x = self._normalize(x)
elif mode == 'denorm':
x = self._denormalize(x)
else:
raise NotImplementedError
return x
def _init_params(self):
self.affine_weight = nn.Parameter(torch.ones(1, self.num_features, 1))
self.affine_bias = nn.Parameter(torch.zeros(1, self.num_features, 1))
def _get_statistics(self, x, mask=None):
"""
x : batch_size x n_channels x seq_len
mask : batch_size x seq_len
"""
if mask is None:
mask = torch.ones((x.shape[0], x.shape[-1]))
n_channels = x.shape[1]
mask = mask.unsqueeze(1).repeat(1, n_channels, 1).bool()
masked_x = torch.where(mask, x, torch.nan)
self.mean = torch.nanmean(masked_x, dim=-1, keepdim=True).detach()
self.stdev = nanstd(masked_x, dim=-1, keepdim=True).detach() + self.eps
def _normalize(self, x):
x = x - self.mean
x = x / self.stdev
if self.affine:
x = x * self.affine_weight
x = x + self.affine_bias
return x
def _denormalize(self, x):
if self.affine:
x = x - self.affine_bias
x = x / (self.affine_weight + self.eps * self.eps)
x = x * self.stdev
x = x + self.mean
return x
ARGS = {
"num_features": 3,
"eps": 1e-5,
"affine": False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type RevIN — 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 RevIN 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
|
| TASKS |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("4d08cfd1aa803db7") 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, TASKS: 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
torch.manual_seed(0)
@dataclass
class TASKS:
PRETRAINING: str = 'pre-training'
LONG_HORIZON_FORECASTING: str = 'long-horizon-forecasting'
SHORT_HORIZON_FORECASTING: str = 'short-horizon-forecasting'
CLASSIFICATION: str = 'classification'
IMPUTATION: str = 'imputation'
ANOMALY_DETECTION: str = 'anomaly-detection'
EMBED: str = 'embed'
ARGS = {
'PRETRAINING': 'pre-training',
'LONG_HORIZON_FORECASTING': 'long-horizon-forecasting',
'SHORT_HORIZON_FORECASTING': 'short-horizon-forecasting',
'CLASSIFICATION': 'classification',
'IMPUTATION': 'imputation',
'ANOMALY_DETECTION': 'anomaly-detection',
'EMBED': 'embed',
}
- 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 TASKS — 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 TASKS 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
|
| TASKS |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("8d65b1c504d83fc0") 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, TASKS: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from dataclasses import dataclass
@dataclass
class TASKS:
RECONSTRUCTION: str = 'reconstruction'
FORECASTING: str = 'forecasting'
CLASSIFICATION: str = 'classification'
EMBED: str = 'embedding'
torch.manual_seed(0)
ARGS = {}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TASKS — 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 TASKS 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
|
| TimeseriesOutputs |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("1f565b96bd1e4975") 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, TimeseriesOutputs: 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
import numpy.typing as npt
torch.manual_seed(0)
ARGS = {
"forecast": np.random.randn(2, 4).astype(np.float32),
"anomaly_scores": np.random.randn(2, 3).astype(np.float32),
"labels": 1,
"input_mask": np.random.randint(0, 2, size=(2, 4)).astype(np.float32),
"pretrain_mask": np.random.randint(0, 2, size=(2, 4)).astype(np.float32),
"reconstruction": np.random.randn(2, 5).astype(np.float32),
"embeddings": np.random.randn(2, 6).astype(np.float32),
"metadata": {"model": "test", "version": 1},
"illegal_output": False,
}
- 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 TimeseriesOutputs — 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 TimeseriesOutputs 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
|
| TimeseriesOutputs |
Ran ran on a synthesized input · constructed an object; no result was computed |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("bf010e749e65008d") 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, TimeseriesOutputs: 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
import numpy.typing as npt
torch.manual_seed(0)
ARGS = {
"forecast": np.random.randn(2, 4).astype(np.float32),
"anomaly_scores": np.random.randn(2, 4).astype(np.float32),
"logits": np.random.randn(2, 3).astype(np.float32),
"labels": 1,
"input_mask": np.random.randint(0, 2, size=(2, 4)).astype(np.float32),
"pretrain_mask": np.random.randint(0, 2, size=(2, 4)).astype(np.float32),
"reconstruction": np.random.randn(2, 4).astype(np.float32),
"embeddings": np.random.randn(2, 5).astype(np.float32),
"metadata": {"key": "value", "count": 42},
"illegal_output": False,
}
- 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 TimeseriesOutputs — 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 TimeseriesOutputs 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
|
| freeze_parameters |
Ran ran; our contract draft was wrong, not the code |
this paper's copy was not recorded; identical code first harvested from wph6/fhbench pointer only · get_code("8828556cf3cc26a1") How it ranThe body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| get_anomaly_criterion |
Ran ran; our contract draft was wrong, not the code |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("94cc1bc7a7a6995e") 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 MSELoss. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'anomaly_criterion': 'mse'
}
- 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 MSELoss — a MSELoss output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MSELoss output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_huggingface_model_dimensions |
Ran ran, honoured the contract we drafted |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("d2455b534e82e3a4") 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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
from unittest.mock import Mock, patch
torch.manual_seed(0)
# Create a mock T5Config that mimics the real one
class MockT5Config:
def __init__(self):
self.d_model = 768
@staticmethod
def from_pretrained(model_name):
return MockT5Config()
# Patch the transformers module to use our mock
import sys
mock_transformers = Mock()
mock_transformers.T5Config = MockT5Config
sys.modules['transformers'] = mock_transformers
ARGS = {
'model_name': 'flan-t5-base'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| nanstd |
Ran ran; our contract draft was wrong, not the code |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("2dcb277b78902447") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor with some NaN values
# Shape: (2, 4) - batch size 2, feature dimension 4
tensor = torch.randn(2, 4)
tensor[0, 1] = float('nan')
tensor[1, 2] = float('nan')
ARGS = {
'tensor': tensor,
'dim': None,
'keepdim': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| nanvar |
Ran ran; our contract draft was wrong, not the code |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("3dc94406bdfb6cc2") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create a small tensor with NaN values
# Shape: (2, 4) - batch size 2, feature dim 4
tensor = torch.tensor([
[1.0, 2.0, 3.0, 4.0],
[5.0, float('nan'), 7.0, 8.0]
], dtype=torch.float32)
ARGS = {
'tensor': tensor,
'dim': None,
'keepdim': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| MOMENT |
Not yet run unverified (harvested, no recorded run) |
moment-timeseries-foundation-model/moment-research/moment/models/moment.py code served (permissive licence) · get_code("a4560854408474a3") How it ran |
| MOMENT |
Not yet run unverified (harvested, no recorded run) |
moment-timeseries-foundation-model/moment/momentfm/models/moment.py code served (permissive licence) · get_code("ead07ddaafd6a621") How it ran |