| AutoCorrelation |
Ran ran on a synthesized input |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("c937754010c54537") 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 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
import math
INIT_ARGS = {
'mask_flag': True,
'factor': 1,
'scale': None,
'attention_dropout': 0.1,
'output_attention': False
}
ARGS = {
'queries': torch.randn(2, 8, 4, 3),
'keys': torch.randn(2, 8, 4, 3),
'values': torch.randn(2, 8, 4, 3),
'attn_mask': None
}
if __name__ == '__main__':
from torch import nn
class AutoCorrelation(nn.Module):
def __init__(self, mask_flag=True, factor=1, scale=None, attention_dropout=0.1, output_attention=False):
super(AutoCorrelation, self).__init__()
self.factor = factor
self.scale = scale
self.mask_flag = mask_flag
self.output_attention = output_attention
self.dropout = nn.Dropout(attention_dropout)
def values_delay_full(self, values, corr):
batch = values.shape[0]
head = values.shape[1]
channel = values.shape[2]
length = values.shape[3]
init_index = torch.arange(length).unsqueeze(0).unsqueeze(0).unsqueeze(0).repeat(batch, head, channel, 1).to(values[0].device)
top_k = int(self.factor * math.log(length))
weights = torch.topk(corr, top_k, dim=-1)[0]
delay = torch.topk(corr, top_k, dim=-1)[1]
delay = length - delay
tmp_corr = torch.softmax(weights, dim=-1)
tmp_values = values.repeat(1, 1, 1, 2)
delays_agg = torch.zeros_like(values).float()
for i in range(top_k):
tmp_delay = init_index + delay[..., i].unsqueeze(-1)
pattern = torch.gather(tmp_values, dim=-1, index=tmp_delay)
delays_agg = delays_agg + pattern * tmp_corr[..., i].unsqueeze(-1)
return delays_agg
def values_delay_channel(self, values, corr):
batch = values.shape[0]
head = values.shape[1]
channel = values.shape[2]
length = values.shape[3]
init_index = torch.arange(length).unsqueeze(0).unsqueeze(0).unsqueeze(0).repeat(batch, head, channel, 1).to(values[0].device)
top_k = int(self.factor * math.log(length))
mean_value = torch.mean(corr, dim=2)
weights = torch.topk(mean_value, top_k, dim=-1)[0]
delay = torch.topk(mean_value, top_k, dim=-1)[1]
tmp_corr = torch.softmax(weights, dim=-1)
tmp_values = values.repeat(1, 1, 1, 2)
delays_agg = torch.zeros_like(values).float()
for i in range(top_k):
tmp_delay = init_index + delay[..., i].unsqueeze(-1).unsqueeze(-1).repeat(1, 1, channel, length)
pattern = torch.gather(tmp_values, dim=-1, index=tmp_delay)
delays_agg = delays_agg + pattern * tmp_corr[..., i].unsqueeze(-1).unsqueeze(-1).repeat(1, 1, channel, length)
return delays_agg
def forward(self, queries, keys, values, attn_mask):
B, L, H, E = queries.shape
_, S, _, D = values.shape
if L > S:
zeros = torch.zeros_like(queries[:, :L - S, :]).float()
values = torch.cat([values, zeros], dim=1)
keys = torch.cat([keys, zeros], dim=1)
else:
values = values[:, :L, :, :]
keys = keys[:, :L, :, :]
q_fft = torch.fft.rfft(queries.permute(0, 2, 3, 1).contiguous(), dim=-1)
k_fft = torch.fft.rfft(keys.permute(0, 2, 3, 1).contiguous(), dim=-1)
res = q_fft * torch.conj(k_fft)
corr = torch.fft.irfft(res, dim=-1)
if self.training:
V = self.values_delay_channel(values.permute(0, 2, 3, 1).contiguous(), corr).permute(0, 3, 1, 2)
else:
V = self.values_delay_channel(values.permute(0, 2, 3, 1).contiguous(), corr).permute(0, 3, 1, 2)
if self.output_attention:
return (V.contiguous(), corr.permute(0, 3, 1, 2))
else:
return (V.contiguous(), None)
model = AutoCorrelation(**INIT_ARGS)
model.eval()
output = model(**ARGS)
print("Output shapes:", output[0].shape, output[1])
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| CausalBlock |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("2a1cd6852143de94") 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, CausalBlock: 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 torch.nn.utils import weight_norm
torch.manual_seed(0)
ARGS = {
"n_inputs": 3,
"n_outputs": 4,
"kernel_size": 3,
"stride": 1,
"dilation": 1,
"padding": 1,
"dropout": 0.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 CausalBlock — 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 CausalBlock 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
|
| CausalConv |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("bc4b6d85c64832c9") 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, CausalConv: 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 torch.nn.utils import weight_norm
torch.manual_seed(0)
class Chomp1d(nn.Module):
def __init__(self, chomp_size):
super(Chomp1d, self).__init__()
self.chomp_size = chomp_size
def forward(self, x):
return x[:, :, :-self.chomp_size].contiguous()
class CausalBlock(nn.Module):
def __init__(self, n_inputs, n_outputs, kernel_size, stride, dilation, padding, dropout=0.2):
super(CausalBlock, self).__init__()
self.conv1 = weight_norm(nn.Conv1d(n_inputs, n_outputs, kernel_size, stride=stride, padding=padding, dilation=dilation))
self.chomp1 = Chomp1d(padding)
self.relu1 = nn.ReLU()
self.dropout1 = nn.Dropout(dropout)
self.conv2 = weight_norm(nn.Conv1d(n_outputs, n_outputs, kernel_size, stride=stride, padding=padding, dilation=dilation))
self.chomp2 = Chomp1d(padding)
self.relu2 = nn.ReLU()
self.dropout2 = nn.Dropout(dropout)
self.net = nn.Sequential(self.conv1, self.chomp1, self.relu1, self.dropout1, self.conv2, self.chomp2, self.relu2, self.dropout2)
self.downsample = nn.Conv1d(n_inputs, n_outputs, 1) if n_inputs != n_outputs else None
self.relu = nn.ReLU()
self.init_weights()
def init_weights(self):
self.conv1.weight.data.normal_(0, 0.01)
self.conv2.weight.data.normal_(0, 0.01)
if self.downsample is not None:
self.downsample.weight.data.normal_(0, 0.01)
def forward(self, x):
out = self.net(x)
res = x if self.downsample is None else self.downsample(x)
return self.relu(out + res)
class CausalConv(nn.Module):
def __init__(self, num_inputs, num_channels, kernel_size=2, dropout=0.2):
super(CausalConv, self).__init__()
layers = []
num_levels = len(num_channels)
for i in range(num_levels):
dilation_size = 3 ** i
in_channels = num_inputs if i == 0 else num_channels[i - 1]
out_channels = num_channels[i]
layers += [CausalBlock(in_channels, out_channels, kernel_size, stride=1, dilation=dilation_size, padding=(kernel_size - 1) * dilation_size, dropout=dropout)]
self.network = nn.Sequential(*layers)
def forward(self, x):
return self.network(x)
ARGS = {
"num_inputs": 4,
"num_channels": [8, 16, 32],
"kernel_size": 2,
"dropout": 0.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 CausalConv — 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 CausalConv 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
|
| Chomp1d |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("5c2a29db14be6a0a") 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, Chomp1d: 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)
ARGS = {
"chomp_size": 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 Chomp1d — 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 Chomp1d 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
|
| CrossCorrelation |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("55d5a3c23533ecf4") 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, CrossCorrelation: 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 minimal causal_fusion module that satisfies how it's used in forward()
class MinimalCausalFusion(nn.Module):
def __init__(self):
super(MinimalCausalFusion, self).__init__()
self.linear = nn.Linear(1, 1)
def forward(self, x):
# x comes in as (B*H, E*L, N)
# Just return it unchanged to satisfy the interface
return x
# Build minimal tensors for forward() call
B = 2 # batch
N = 3 # nodes
L = 4 # query length
H = 5 # heads
E = 6 # embedding dimension
S = 4 # key/value length
queries = torch.randn(B, N, L, H, E)
keys = torch.randn(B, N, S, H, E)
values = torch.randn(B, N, S, H, E)
attn_mask = None
ARGS = {
'causal_fusion': MinimalCausalFusion(),
'mask_flag': True,
'factor': 2,
'scale': None,
'attention_dropout': 0.1,
'output_attention': 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 CrossCorrelation — 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 CrossCorrelation 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
|
| CrossCorrelationLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("dbc3b380a430e700") 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, CrossCorrelationLayer: 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)
# Define a minimal correlation module that satisfies the interface
class MinimalCorrelation(nn.Module):
def forward(self, queries, keys, values, attn_mask):
# queries, keys, values shape: (batch, n_nodes, seq_len, n_heads, d_keys)
# Return output and attention
B, N, L, H, D = queries.shape
out = torch.randn(B, N, L, H, D)
attn = torch.randn(B, N, L, L)
return out, attn
# Create instances
d_model = 8
n_heads = 2
d_keys = 4
d_values = 4
correlation_module = MinimalCorrelation()
ARGS = {
'correlation': correlation_module,
'd_model': d_model,
'n_heads': n_heads,
'd_keys': d_keys,
'd_values': d_values,
}
- 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 CrossCorrelationLayer — 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 CrossCorrelationLayer 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
|
| DataEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("c4a745f5f73145a0") 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, DataEmbedding: 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 json
import tempfile
import os
import numpy as np
from sklearn.preprocessing import StandardScaler
torch.manual_seed(0)
# Create a temporary directory with meta_info.json
temp_dir = tempfile.mkdtemp()
meta_info = {
"station_0": {"latitude": 40.7128, "ELEVATION": 10},
"station_1": {"latitude": 34.0522, "ELEVATION": 285},
"station_2": {"latitude": 41.8781, "ELEVATION": 181},
"station_3": {"latitude": 29.7604, "ELEVATION": 47},
}
meta_info_path = os.path.join(temp_dir, "meta_info.json")
with open(meta_info_path, "w") as f:
json.dump(meta_info, f)
# Create sample data
c_in = 3 # number of input channels
d_model = 8 # model dimension
node_num = 2 # number of nodes
batch_size = 2 # batch size
seq_len = 4 # sequence length
# Create dummy x tensor: (batch, seq_len, c_in)
x = torch.randn(batch_size, seq_len, c_in)
# Create dummy x_mark tensor with temporal information
# Format expected by TemporalEmbedding: (batch, seq_len, 5) where
# indices are [month, day, weekday, hour, minute]
x_mark = torch.tensor([
[[1, 15, 3, 10, 0], [1, 15, 3, 11, 0], [1, 15, 3, 12, 0], [1, 15, 3, 13, 0]],
[[1, 16, 4, 8, 0], [1, 16, 4, 9, 0], [1, 16, 4, 10, 0], [1, 16, 4, 11, 0]]
], dtype=torch.float32)
ARGS = {
"c_in": c_in,
"d_model": d_model,
"root_path": temp_dir,
"node_num": node_num,
"embed_type": "fixed",
"freq": "h",
"dropout": 0.1,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type DataEmbedding — 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 DataEmbedding 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
|
| Decoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("2601733ce09afb32") 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, Decoder: 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 minimal decoder layer that matches the expected interface
class DecoderLayer(nn.Module):
def __init__(self, d_model=4):
super(DecoderLayer, self).__init__()
self.linear = nn.Linear(d_model, d_model)
def forward(self, x, cross, x_mask=None, cross_mask=None):
# Returns (output, residual_trend)
output = self.linear(x)
residual_trend = torch.zeros(x.shape[0], 1, dtype=x.dtype) # batch_size x 1
return output, residual_trend
# Create minimal layers list
layers = [
DecoderLayer(d_model=4),
DecoderLayer(d_model=4)
]
# Create a norm layer (called in forward)
norm_layer = nn.LayerNorm(4)
# Create a projection layer (called in forward)
projection = nn.Linear(4, 3)
# Prepare input tensors for forward pass
batch_size = 2
seq_len = 5
d_model = 4
x = torch.randn(batch_size, seq_len, d_model)
cross = torch.randn(batch_size, seq_len, d_model)
x_mask = None
cross_mask = None
trend = torch.zeros(batch_size, 1)
ARGS = {
"layers": layers,
"norm_layer": norm_layer,
"projection": projection
}
- 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 Decoder — 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 Decoder 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
|
| DecoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("ba4b7db0656f9fd6") 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, DecoderLayer: 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)
# Build minimal mock attention/correlation modules
class MockMultiCorrelation(nn.Module):
def forward(self, x, y, mask=None):
# Should return tensor of same shape as x
return torch.zeros_like(x)
class MockCrossMultiCorrelation(nn.Module):
def forward(self, x, cross, mask=None):
# Should return tensor of same shape as x
return torch.zeros_like(x)
# Create instances
multi_correlation = MockMultiCorrelation()
cross_multi_correlation = MockCrossMultiCorrelation()
# Parameters for DecoderLayer
d_model = 4 # model dimension
c_out = 3 # output channels (distinct from d_model)
d_ff = 16 # feed-forward dimension
moving_avg_kernel = 25 # kernel size for moving average
dropout = 0.1
activation = 'relu'
ARGS = {
'multi_correlation': multi_correlation,
'cross_multi_correlation': cross_multi_correlation,
'd_model': d_model,
'c_out': c_out,
'd_ff': d_ff,
'moving_avg': moving_avg_kernel,
'dropout': dropout,
'activation': activation
}
- 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 DecoderLayer — 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 DecoderLayer 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
|
| Encoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("23a94c41f4335756") 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, Encoder: 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 attention layer that accepts x and attn_mask
class SimpleAttentionLayer(nn.Module):
def __init__(self, dim):
super(SimpleAttentionLayer, self).__init__()
self.linear = nn.Linear(dim, dim)
def forward(self, x, attn_mask=None):
# Simple pass-through with linear transformation
return self.linear(x)
# Create attention layers
attn_layers = [
SimpleAttentionLayer(4),
SimpleAttentionLayer(4)
]
# Create a norm layer
norm_layer = nn.LayerNorm(4)
# Define ARGS dict
ARGS = {
'attn_layers': attn_layers,
'norm_layer': norm_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 Encoder — 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 Encoder 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
|
| EncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("ed00dfdc4c788366") 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, EncoderLayer: 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 minimal multi_correlation module that satisfies the usage pattern
class DummyMultiCorrelation(nn.Module):
def __init__(self, d_model):
super().__init__()
self.d_model = d_model
self.linear = nn.Linear(d_model, d_model)
def forward(self, q, k, attn_mask=None):
# The function calls: self.multi_correlation(x, x, attn_mask)
# x shape is (batch, seq_len, d_model)
# Return same shape as input
return self.linear(q)
# Create instances
d_model = 4
d_ff = 16
moving_avg_kernel = 25
dropout = 0.1
activation = 'relu'
multi_correlation = DummyMultiCorrelation(d_model)
ARGS = {
'multi_correlation': multi_correlation,
'd_model': d_model,
'd_ff': d_ff,
'moving_avg': moving_avg_kernel,
'dropout': dropout,
'activation': activation
}
- 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 EncoderLayer — 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 EncoderLayer 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
|
| GeoPositionalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("3d2068507fa9d360") 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, GeoPositionalEmbedding: 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)
# GeoPositionalEmbedding takes c_in and d_model as constructor parameters
# c_in: input feature dimension (number of input channels/coordinates)
# d_model: output embedding dimension
c_in = 4 # input coordinate dimension
d_model = 3 # output embedding dimension
ARGS = {
'c_in': c_in,
'd_model': d_model,
}
- 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 GeoPositionalEmbedding — 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 GeoPositionalEmbedding 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
|
| MultiCorrelation |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("55fc5b1b9eb20a44") 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, MultiCorrelation: 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 minimal auto_correlation module
class AutoCorrelation(nn.Module):
def forward(self, q, k, v, attn_mask=None):
# Return tuple with tensor of shape (B, L, C)
B, L, C = q.shape
output = torch.randn(B, L, C)
return (output, None)
# Create a minimal cross_correlation module
class CrossCorrelation(nn.Module):
def forward(self, q, k, v, attn_mask=None, n_nodes=None):
# Return tuple with tensor of shape (B, S, C)
B, S, C = q.shape
output = torch.randn(B, S, C)
return (output, None)
# Instantiate the correlation modules
auto_corr = AutoCorrelation()
cross_corr = CrossCorrelation()
# Parameters for MultiCorrelation
node_num = 2 # B // node_num should divide batch size evenly
node_list = [2, 2] # Product should divide batch size
dropout_rate = 0.1
ARGS = {
'auto_correlation': auto_corr,
'cross_correlation': cross_corr,
'node_num': node_num,
'nodel_list': node_list, # Note: parameter has typo "nodel_list"
'dropout': dropout_rate
}
- 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 MultiCorrelation — 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 MultiCorrelation 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
|
| moving_avg |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("627811d6e342bdbf") 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, moving_avg: 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)
# The moving_avg module expects:
# - kernel_size: int, used in AvgPool1d and for repeat operations
# - stride: int, used in AvgPool1d
# - forward() expects x: tensor of shape (batch, time_steps, features)
# Create small test tensor: batch=2, time_steps=4, features=3
x = torch.randn(2, 4, 3)
ARGS = {
'kernel_size': 3,
'stride': 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 moving_avg — 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 moving_avg 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
|
| my_Layernorm |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("bf5431d9a57a906b") 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, my_Layernorm: 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)
# The function __init__ takes 'channels' parameter
# Looking at the forward method, x is expected to be a tensor
# The forward uses:
# - self.layernorm(x) which is nn.LayerNorm(channels)
# - torch.mean(x_hat, dim=1) which reduces along dimension 1
# - unsqueeze(1) and repeat(1, x.shape[1], 1)
# This suggests x should have shape (batch, seq_len, channels)
# where channels matches the parameter
channels = 4
batch_size = 2
seq_len = 3
ARGS = {
'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 my_Layernorm — 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 my_Layernorm 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
|
| series_decomp |
Ran ran on a synthesized input · constructed an object; no result was computed |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("0476441daf861ec1") 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, series_decomp: 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)
# series_decomp takes one parameter: kernel_size
# It creates a moving_avg module internally with kernel_size and stride=1
# The forward method expects input x and calls self.moving_avg(x)
# moving_avg expects x to have shape (batch, seq_len, features)
ARGS = {
"kernel_size": 3
}
- 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 series_decomp — 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 series_decomp 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
|
| Model |
Not yet run unverified (harvested, no recorded run) |
taohan10200/weather-5k/models/Corrformer.py code served (permissive licence) · get_code("b8cc3b42dec2929e") How it ran |