| AttentionLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("e75ce51f514cede4") 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, AttentionLayer: 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 attention module that satisfies the inner_attention interface
class MinimalAttention(nn.Module):
def forward(self, queries, keys, values, attention_mask):
# queries: (B, L, H, d_keys)
# keys: (B, S, H, d_keys)
# values: (B, S, H, d_values)
# Returns: (out, attention)
B, L, H, d_k = queries.shape
S = keys.shape[1]
d_v = values.shape[3]
# Simple attention: just return values reshaped appropriately
# out shape should be (B, L, H, d_values) or (B, H, L, d_values) depending on mix
out = values.expand(B, L, H, d_v)
attention = torch.ones(B, H, L, S)
return out, attention
# Instantiate the inner attention module
inner_attention = MinimalAttention()
# Parameters for AttentionLayer
d_model = 8
n_heads = 2
d_keys = 4
d_values = 4
mix = False
ARGS = {
'attention': inner_attention,
'd_model': d_model,
'n_heads': n_heads,
'd_keys': d_keys,
'd_values': d_values,
'mix': mix
}
- 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 AttentionLayer — 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 AttentionLayer 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
|
| AttentionLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("b3037a636b1488b2") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| AttentionLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("959c303f905ec82e") 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, AttentionLayer: 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 attention module that satisfies the inner_attention interface
class MinimalAttention(nn.Module):
def forward(self, queries, keys, values, attn_mask):
# queries, keys, values have shape (B, L/S, H, d_k/d_v)
# Return (output, attention_weights)
B, L, H, d_v = values.shape
# Simple output: just return values reshaped, and dummy attention
out = values # (B, S, H, d_v)
attn = torch.ones(B, H, L, L) # dummy attention weights
return out, attn
# Parameters for AttentionLayer
d_model = 8
n_heads = 2
d_keys = 4
d_values = 4
attention_module = MinimalAttention()
ARGS = {
'attention': attention_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 AttentionLayer — 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 AttentionLayer 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
|
| AttentionLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("2fb65948fb331ab5") 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, AttentionLayer: 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 tensorflow as tf
import numpy as np
# Define a simple attention mechanism that the layer will use internally
class SimpleAttention(tf.keras.layers.Layer):
def __init__(self):
super(SimpleAttention, self).__init__()
def call(self, inputs, attn_mask=None):
# inputs is [queries, keys, values]
queries, keys, values = inputs
# Return a simple combination with shape (B, L, H, d_values)
return values
# Create attention mechanism instance
attention = SimpleAttention()
# Parameters
d_model = 8
n_heads = 2
d_keys = 4
d_values = 4
ARGS = {
'attention': attention,
'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
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type AttentionLayer — 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 AttentionLayer 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
|
| ConvLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("ece191004f71a0a6") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| ConvLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("90e6de76603c9ae2") 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, ConvLayer: 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)
# ConvLayer only takes c_in as a parameter
# c_in is the number of input channels
c_in = 4
ARGS = {
'c_in': c_in
}
- 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 ConvLayer — 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 ConvLayer 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
|
| ConvLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("5523438213912ed4") 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, ConvLayer: 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 tensorflow as tf
import numpy as np
# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)
# Create a ConvLayer instance
c_in = 16
conv_layer = tf.keras.Sequential([
tf.keras.layers.Conv1D(filters=c_in, kernel_size=3, padding='causal'),
tf.keras.layers.BatchNormalization(),
tf.keras.layers.ELU(),
tf.keras.layers.MaxPool1D(pool_size=3, strides=2)
])
# Build the layer with input shape (batch_size, sequence_length, channels)
# Using batch_size=2, sequence_length=4, channels=16
input_tensor = tf.random.normal((2, 4, c_in))
conv_layer.build(input_tensor.shape)
ARGS = {
"c_in": 16
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ConvLayer — 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 ConvLayer 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
|
| ConvLayer |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("c26cdbaa0235c38e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 4, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
class ConvLayer(nn.Module):
def __init__(self, c_in):
super(ConvLayer, self).__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.downConv = nn.Conv1d(in_channels=c_in, out_channels=c_in, kernel_size=3, padding=padding, padding_mode='circular')
self.norm = nn.BatchNorm1d(c_in)
self.activation = nn.ELU()
self.maxPool = nn.MaxPool1d(kernel_size=3, stride=2, padding=1)
def forward(self, x):
x = self.downConv(x.permute(0, 2, 1))
x = self.norm(x)
x = self.activation(x)
x = self.maxPool(x)
x = x.transpose(1, 2)
return x
INIT_ARGS = {
'c_in': 4
}
ARGS = {
'x': torch.randn(2, 7, 4)
}
if __name__ == '__main__':
model = ConvLayer(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| DataEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("cb33a7664fc29bcd") 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
torch.manual_seed(0)
# Set up arguments for DataEmbedding
c_in = 3 # number of input channels
d_model = 8 # model dimension
embedding_type = 'fixed' # can be 'fixed', 'learned', or 'timefeature'
frequency = 'h' # hourly frequency
dropout = 0.1
ARGS = {
'c_in': c_in,
'd_model': d_model,
'embedding_type': embedding_type,
'frequency': frequency,
'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 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
|
| DataEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("3103f383ce197db7") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| DataEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("3585c641aefa6f6a") 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
from torch import nn
import math
torch.manual_seed(0)
# Create small tensors for input
# x shape: (batch_size, seq_len, c_in)
batch_size = 2
seq_len = 3
c_in = 4 # number of input channels
d_model = 8 # dimensionality of model
x = torch.randn(batch_size, seq_len, c_in)
# x_mark shape: (batch_size, seq_len, 6) for temporal features
# The forward method accesses indices 0-5: month, day, weekday, hour, minute, second
x_mark = torch.randint(0, 13, (batch_size, seq_len, 6))
ARGS = {
'c_in': c_in,
'd_model': d_model,
'embed_type': 'fixed',
'freq': 'Sec',
'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 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
|
| DataEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("e430cc85d15ea52c") 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 tensorflow as tf
import numpy as np
# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)
# Create small test tensors
batch_size = 2
seq_len = 4
c_in = 3
d_model = 8
# x: input tensor with shape (batch_size, seq_len, c_in)
# This is the value tensor
x = tf.cast(tf.random.normal((batch_size, seq_len, c_in)), tf.float32)
# x_mark: temporal information tensor with shape (batch_size, seq_len, 5)
# The 5 dimensions correspond to: [month, day, weekday, hour, minute]
# Values should be valid indices for the embeddings
x_mark = tf.constant([
[[0, 1, 2, 3, 1], # month=0, day=1, weekday=2, hour=3, minute=1
[1, 2, 3, 4, 2],
[2, 3, 4, 5, 1],
[3, 4, 5, 6, 0]],
[[0, 1, 2, 3, 1],
[1, 2, 3, 4, 2],
[2, 3, 4, 5, 1],
[3, 4, 5, 6, 0]]
], dtype=tf.int32)
ARGS = {
'c_in': c_in,
'd_model': d_model,
'embed_type': 'fixed',
'data': 'ETTh',
'dropout': 0.1,
'seq_len': seq_len
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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 |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("9371d53b3cf8de99") 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 MinimalDecoderLayer(nn.Module):
def __init__(self, d_model=4):
super().__init__()
self.linear = nn.Linear(d_model, d_model)
def forward(self, x, cross, x_mask=None, cross_mask=None):
# The layer receives x, cross, and optional masks
# Return transformed x
return self.linear(x)
# Create a minimal norm layer
norm_layer = nn.LayerNorm(4)
# Create decoder layers
decoder_layers = nn.ModuleList([
MinimalDecoderLayer(d_model=4),
MinimalDecoderLayer(d_model=4)
])
ARGS = {
'layers': decoder_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 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
|
| Decoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("6633278fb36185f5") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| Decoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("50812a6b5a3f764f") 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)
# Define a minimal DecoderLayer that matches the interface used in Decoder.forward
class DecoderLayer(nn.Module):
def __init__(self, d_model=4):
super(DecoderLayer, self).__init__()
self.d_model = d_model
def forward(self, x, cross, x_mask=None, cross_mask=None):
# Minimal implementation: just pass through x
# The layer receives x, cross, x_mask, cross_mask as shown in Decoder.forward
return x
# Create decoder layers
decoder_layers = [
DecoderLayer(d_model=4),
DecoderLayer(d_model=4),
]
# Create a normalization layer
norm_layer = nn.LayerNorm(4)
# Create a projection layer
projection_layer = nn.Linear(4, 3)
# Create small tensors for forward pass testing
# x: (batch=2, seq_len=5, d_model=4)
# cross: (batch=2, cross_seq_len=6, d_model=4)
x = torch.randn(2, 5, 4)
cross = torch.randn(2, 6, 4)
ARGS = {
'layers': decoder_layers,
'norm_layer': norm_layer,
'projection': projection_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 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
|
| Decoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("93097c8261b019e4") 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 tensorflow as tf
from tensorflow.python.keras.engine.base_layer import Layer
from tensorflow.python.keras import layers as keras_layers
import numpy as np
# Define a minimal layer that matches the expected call signature
class MockDecoderLayer(Layer):
def __init__(self):
super(MockDecoderLayer, self).__init__()
def call(self, x, cross=None, x_mask=None, cross_mask=None):
# Just pass through the input
return x
# Define a minimal normalization layer
class MockNormLayer(Layer):
def __init__(self):
super(MockNormLayer, self).__init__()
def call(self, x):
return x
# Create small test tensors
batch_size = 2
seq_length = 5
feature_dim = 4
# Create list of decoder layers
decoder_layers = [
MockDecoderLayer(),
MockDecoderLayer(),
]
# Create normalization layer
norm_layer = MockNormLayer()
# Define ARGS dictionary with all parameters
ARGS = {
'layers': decoder_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
- numpy, tensorflow — 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 |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("da4711602410c52c") 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 self-attention module that returns (output, None)
class MinimalAttention(nn.Module):
def __init__(self, d_model):
super().__init__()
self.d_model = d_model
def forward(self, query, key, value, attention_mask=None):
# Returns tuple (output, weights) as expected by the code
batch_size, seq_len, d_model = query.shape
output = torch.randn(batch_size, seq_len, d_model)
return output, None
# Build minimal cross-attention module that returns (output, None)
class MinimalCrossAttention(nn.Module):
def __init__(self, d_model):
super().__init__()
self.d_model = d_model
def forward(self, query, key, value, attention_mask=None):
# Returns tuple (output, weights) as expected by the code
batch_size, seq_len, d_model = query.shape
output = torch.randn(batch_size, seq_len, d_model)
return output, None
d_model = 4
d_ff = 16
batch_size = 2
seq_len = 3
cross_seq_len = 5
self_attention = MinimalAttention(d_model)
cross_attention = MinimalCrossAttention(d_model)
ARGS = {
'self_attention': self_attention,
'cross_attention': cross_attention,
'd_model': d_model,
'd_ff': d_ff,
'dropout': 0.1,
'activation': 'relu'
}
- 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
|
| DecoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("50c2f756e8a28edb") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| DecoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("80e44c571e571357") 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 self-attention module
class SimpleAttention(nn.Module):
def __init__(self, d_model):
super().__init__()
self.d_model = d_model
def forward(self, q, k, v, attn_mask=None):
# Returns tuple (output, attention_weights)
batch_size, seq_len, d_model = q.shape
output = torch.randn(batch_size, seq_len, d_model)
attn_weights = torch.randn(batch_size, seq_len, seq_len)
return output, attn_weights
# Parameters
d_model = 4
d_ff = 16
dropout = 0.1
activation = 'relu'
# Create attention modules
self_attention = SimpleAttention(d_model)
cross_attention = SimpleAttention(d_model)
ARGS = {
'self_attention': self_attention,
'cross_attention': cross_attention,
'd_model': d_model,
'd_ff': d_ff,
'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
|
| DecoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("373de80bb388a8f6") 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 tensorflow as tf
import numpy as np
# Create a minimal attention layer that satisfies the interface
class MinimalAttention(tf.keras.layers.Layer):
def __init__(self):
super(MinimalAttention, self).__init__()
def call(self, inputs, attn_mask=None):
# inputs is [query, key, value]
# Return output with same shape as query
query = inputs[0]
return tf.zeros_like(query)
# Set random seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)
# Create minimal attention instances
self_attention = MinimalAttention()
cross_attention = MinimalAttention()
# Model dimension
d_model = 4
# Feed-forward dimension (will default to 4 * d_model if not provided)
d_ff = 16
# Dropout rate
dropout = 0.1
# Activation function
activation = 'relu'
ARGS = {
'self_attention': self_attention,
'cross_attention': cross_attention,
'd_model': d_model,
'd_ff': d_ff,
'dropout': dropout,
'activation': activation
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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
|
| DecoderLayer |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("3c106372e0a83470") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
class SimpleAttention(nn.Module):
def __init__(self, d_model):
super(SimpleAttention, self).__init__()
self.d_model = d_model
self.linear_q = nn.Linear(d_model, d_model)
self.linear_k = nn.Linear(d_model, d_model)
self.linear_v = nn.Linear(d_model, d_model)
def forward(self, q, k, v, attn_mask=None):
q = self.linear_q(q)
k = self.linear_k(k)
v = self.linear_v(v)
scores = torch.matmul(q, k.transpose(-2, -1)) / (self.d_model ** 0.5)
if attn_mask is not None:
scores = scores.masked_fill(attn_mask == 0, float('-inf'))
attn_weights = F.softmax(scores, dim=-1)
output = torch.matmul(attn_weights, v)
return output, attn_weights
class DecoderLayer(nn.Module):
def __init__(self, self_attention, cross_attention, d_model, d_ff=None, dropout=0.1, activation='relu'):
super(DecoderLayer, self).__init__()
d_ff = d_ff or 4 * d_model
self.self_attention = self_attention
self.cross_attention = cross_attention
self.conv1 = nn.Conv1d(in_channels=d_model, out_channels=d_ff, kernel_size=1)
self.conv2 = nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1)
self.norm1 = nn.LayerNorm(d_model)
self.norm2 = nn.LayerNorm(d_model)
self.norm3 = nn.LayerNorm(d_model)
self.dropout = nn.Dropout(dropout)
self.activation = F.relu if activation == 'relu' else F.gelu
def forward(self, x, cross, x_mask=None, cross_mask=None):
x = x + self.dropout(self.self_attention(x, x, x, attn_mask=x_mask)[0])
x = self.norm1(x)
x = x + self.dropout(self.cross_attention(x, cross, cross, attn_mask=cross_mask)[0])
y = x = self.norm2(x)
y = self.dropout(self.activation(self.conv1(y.transpose(-1, 1))))
y = self.dropout(self.conv2(y).transpose(-1, 1))
return self.norm3(x + y)
d_model = 4
d_ff = 16
seq_len = 3
cross_seq_len = 5
batch_size = 2
self_attn = SimpleAttention(d_model)
cross_attn = SimpleAttention(d_model)
INIT_ARGS = {
'self_attention': self_attn,
'cross_attention': cross_attn,
'd_model': d_model,
'd_ff': d_ff,
'dropout': 0.1,
'activation': 'relu'
}
ARGS = {
'x': torch.randn(batch_size, seq_len, d_model),
'cross': torch.randn(batch_size, cross_seq_len, d_model),
'x_mask': None,
'cross_mask': None
}
decoder_layer = DecoderLayer(**INIT_ARGS)
output = decoder_layer(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| Encoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("0ba91cc00e21b335") 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 minimal attention layer that returns (output, attention)
class MinimalAttentionLayer(nn.Module):
def __init__(self, dim):
super().__init__()
self.linear = nn.Linear(dim, dim)
def forward(self, x, attention_mask=None):
output = self.linear(x)
attention = torch.randn(x.size(0), x.size(1), x.size(1))
return output, attention
# Create a minimal conv layer
class MinimalConvLayer(nn.Module):
def __init__(self, dim):
super().__init__()
self.conv = nn.Conv1d(dim, dim, kernel_size=1)
def forward(self, x):
# x shape: (batch, seq_len, dim)
# conv1d expects (batch, dim, seq_len)
x = x.transpose(1, 2)
x = self.conv(x)
x = x.transpose(1, 2)
return x
# Create a minimal norm layer
class MinimalNorm(nn.Module):
def __init__(self, dim):
super().__init__()
self.norm = nn.LayerNorm(dim)
def forward(self, x):
return self.norm(x)
# Set up parameters
dim = 4
seq_len = 3
batch_size = 2
# Create attention layers (3 layers)
attention_layers = [
MinimalAttentionLayer(dim),
MinimalAttentionLayer(dim),
MinimalAttentionLayer(dim),
]
# Create conv layers (2 layers, one fewer than attention layers)
conv_layers = [
MinimalConvLayer(dim),
MinimalConvLayer(dim),
]
# Create norm layer
norm_layer = MinimalNorm(dim)
ARGS = {
"attention_layers": attention_layers,
"conv_layers": conv_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
|
| Encoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("24cd22b81486e6cf") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| Encoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("adb27dc3b112b5b7") 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)
class EncoderLayer(nn.Module):
def __init__(self, d_model, nhead=2):
super().__init__()
self.self_attn = nn.MultiheadAttention(d_model, nhead, batch_first=True)
self.linear = nn.Linear(d_model, d_model)
def forward(self, x, attn_mask=None):
attn_output, attn_weights = self.self_attn(x, x, x, attn_mask=attn_mask)
x = x + attn_output
x = self.linear(x)
return x, attn_weights
class ConvLayer(nn.Module):
def __init__(self, d_model):
super().__init__()
self.conv = nn.Conv1d(d_model, d_model, kernel_size=3, padding=1)
def forward(self, x):
batch, seq_len, d_model = x.shape
x = x.transpose(1, 2)
x = self.conv(x)
x = x.transpose(1, 2)
return x
d_model = 4
seq_len = 3
batch_size = 2
attn_layers = [
EncoderLayer(d_model, nhead=2),
EncoderLayer(d_model, nhead=2),
]
conv_layers = [
ConvLayer(d_model),
]
norm_layer = nn.LayerNorm(d_model)
ARGS = {
"attn_layers": attn_layers,
"conv_layers": conv_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
|
| Encoder |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("9cd2a01692c6a304") 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 tensorflow as tf
import numpy as np
# Create mock attention layer
class MockAttentionLayer(tf.keras.layers.Layer):
def __init__(self):
super(MockAttentionLayer, self).__init__()
def call(self, x, attn_mask=None):
# Simple passthrough with a small transformation
return x * 0.9
# Create mock conv layer
class MockConvLayer(tf.keras.layers.Layer):
def __init__(self):
super(MockConvLayer, self).__init__()
def call(self, x):
# Simple passthrough with a small transformation
return x * 0.95
# Create mock norm layer
class MockNormLayer(tf.keras.layers.Layer):
def __init__(self):
super(MockNormLayer, self).__init__()
def call(self, x):
# Simple layer normalization
return tf.nn.l2_normalize(x, axis=-1)
# Construct arguments
attn_layers = [
MockAttentionLayer(),
MockAttentionLayer(),
MockAttentionLayer()
]
conv_layers = [
MockConvLayer(),
MockConvLayer()
]
norm_layer = MockNormLayer()
ARGS = {
"attn_layers": attn_layers,
"conv_layers": conv_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
- numpy, tensorflow — 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
|
| Encoder |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("f832bb8dfa1e0d3d") 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
class DummyAttentionLayer(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, x, attn_mask=None):
# x shape: (batch, seq_len, d_model)
out = self.linear(x)
# Return output and dummy attention weights
batch, seq_len, _ = x.shape
attn = torch.ones(batch, seq_len, seq_len) / seq_len
return out, attn
class DummyConvLayer(nn.Module):
def __init__(self, d_model):
super().__init__()
self.conv = nn.Conv1d(d_model, d_model, kernel_size=3, padding=1)
def forward(self, x):
# x shape: (batch, seq_len, d_model)
# Conv1d expects (batch, channels, length)
x_transposed = x.transpose(1, 2)
out = self.conv(x_transposed)
out = out.transpose(1, 2)
return out
d_model = 8
num_attn_layers = 3
attn_layers = [DummyAttentionLayer(d_model) for _ in range(num_attn_layers)]
conv_layers = [DummyConvLayer(d_model) for _ in range(num_attn_layers - 1)]
norm_layer = nn.LayerNorm(d_model)
INIT_ARGS = {
'attn_layers': attn_layers,
'conv_layers': conv_layers,
'norm_layer': norm_layer
}
batch_size = 2
seq_len = 5
x = torch.randn(batch_size, seq_len, d_model)
attn_mask = None
ARGS = {
'x': x,
'attn_mask': attn_mask
}
- 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)
|
| EncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("b133a666f2dfc30a") 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)
# Define a minimal attention module that implements the interface used
class MinimalAttention(nn.Module):
def __init__(self, d_model):
super(MinimalAttention, self).__init__()
self.d_model = d_model
def forward(self, query, key, value, attention_mask=None):
# Return (output, attention_weights)
batch_size = query.shape[0]
seq_len = query.shape[1]
attention_weights = torch.ones(batch_size, seq_len, seq_len)
output = torch.randn(batch_size, seq_len, self.d_model)
return output, attention_weights
# Create instances
d_model = 4
d_ff = 16
dropout = 0.1
activation = 'relu'
attention = MinimalAttention(d_model)
ARGS = {
'attention': attention,
'd_model': d_model,
'd_ff': d_ff,
'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
|
| EncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("f6e4afd880144625") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| EncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("d4eb251d3b9b8157") 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 attention module that satisfies the interface used in EncoderLayer
class MinimalAttention(nn.Module):
def __init__(self, d_model):
super(MinimalAttention, self).__init__()
self.d_model = d_model
def forward(self, q, k, v, attn_mask=None):
# Returns (output, attention_weights)
# output should have same shape as input
batch_size = q.size(0)
seq_len = q.size(1)
output = torch.randn(batch_size, seq_len, self.d_model)
attn_weights = torch.randn(batch_size, seq_len, seq_len)
return output, attn_weights
# Parameters
d_model = 4
d_ff = 16
dropout = 0.1
activation = 'relu'
# Create attention module
attention = MinimalAttention(d_model=d_model)
ARGS = {
'attention': attention,
'd_model': d_model,
'd_ff': d_ff,
'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
|
| EncoderLayer |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("f55313b7a30a6024") 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 tensorflow as tf
import numpy as np
# Create a minimal attention module that satisfies the interface
class MinimalAttention(tf.keras.layers.Layer):
def __init__(self):
super(MinimalAttention, self).__init__()
def call(self, inputs, attn_mask=None):
# inputs is [query, key, value]
# Return a tensor of same shape as query
query = inputs[0]
return tf.zeros_like(query)
# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)
# Create the attention module instance
attention = MinimalAttention()
# Define model dimension
d_model = 8
# Build ARGS dictionary with all required parameters
ARGS = {
'attention': attention,
'd_model': d_model,
'd_ff': 32, # 4 * d_model
'dropout': 0.1,
'activation': 'relu'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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
|
| EncoderLayer |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("83c2325d104455ec") 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 torch.nn.functional as F
class SimpleAttention(nn.Module):
"""Stand-in attention module that returns (output, attention_weights)"""
def __init__(self, d_model):
super(SimpleAttention, self).__init__()
self.d_model = d_model
def forward(self, q, k, v, attn_mask=None):
batch_size = q.shape[0]
seq_len = q.shape[1]
# Simple scaled dot-product attention
scores = torch.matmul(q, k.transpose(-2, -1)) / (self.d_model ** 0.5)
if attn_mask is not None:
scores = scores.masked_fill(attn_mask == 0, float('-inf'))
attn_weights = F.softmax(scores, dim=-1)
output = torch.matmul(attn_weights, v)
return output, attn_weights
class EncoderLayer(nn.Module):
def __init__(self, attention, d_model, d_ff=None, dropout=0.1, activation='relu'):
super(EncoderLayer, self).__init__()
d_ff = d_ff or 4 * d_model
self.attention = attention
self.conv1 = nn.Conv1d(in_channels=d_model, out_channels=d_ff, kernel_size=1)
self.conv2 = nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1)
self.norm1 = nn.LayerNorm(d_model)
self.norm2 = nn.LayerNorm(d_model)
self.dropout = nn.Dropout(dropout)
self.activation = F.relu if activation == 'relu' else F.gelu
def forward(self, x, attn_mask=None):
new_x, attn = self.attention(x, x, x, attn_mask=attn_mask)
x = x + self.dropout(new_x)
y = x = self.norm1(x)
y = self.dropout(self.activation(self.conv1(y.transpose(-1, 1))))
y = self.dropout(self.conv2(y).transpose(-1, 1))
return (self.norm2(x + y), attn)
d_model = 4
d_ff = 16
batch_size = 2
seq_len = 3
attention_module = SimpleAttention(d_model)
INIT_ARGS = {
'attention': attention_module,
'd_model': d_model,
'd_ff': d_ff,
'dropout': 0.1,
'activation': 'relu'
}
ARGS = {
'x': torch.randn(batch_size, seq_len, d_model),
'attn_mask': None
}
if __name__ == '__main__':
encoder_layer = EncoderLayer(**INIT_ARGS)
output, attn = encoder_layer(**ARGS)
print("Output shape:", output.shape)
print("Attention shape:", attn.shape)
- 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)
|
| FixedEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("11d00cdc1be5dc46") 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, FixedEmbedding: 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 math
torch.manual_seed(0)
# Parameters for FixedEmbedding.__init__
c_in = 5 # number of embedding entries
d_model = 4 # 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 FixedEmbedding — 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 FixedEmbedding 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
|
| FixedEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("d54ef7cb9071ad5d") 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, FixedEmbedding: 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)
# FixedEmbedding takes c_in and d_model as parameters
# c_in: number of input channels (sequence length dimension)
# d_model: dimensionality of output vectors
ARGS = {
'c_in': 8, # number of positions/input channels
'd_model': 16 # dimensionality of model embeddings
}
- 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 FixedEmbedding — 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 FixedEmbedding 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
|
| FixedEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("0545de0df17c8182") 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, FixedEmbedding: 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 tensorflow as tf
import numpy as np
import math
# Set up seeds for reproducibility
np.random.seed(0)
tf.random.set_seed(0)
# Define ARGS with the required parameters for FixedEmbedding
ARGS = {
'c_in': 5, # number of input positions/vocabulary size
'd_model': 4 # embedding dimension
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type FixedEmbedding — 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 FixedEmbedding 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
|
| FullAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("8f1c5d305ce86430") 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, FullAttention: 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 numpy as np
import math
torch.manual_seed(0)
# Define tensor dimensions
B = 2 # batch size
L = 3 # sequence length for queries
S = 3 # sequence length for keys/values
H = 4 # number of heads
E = 5 # embedding dimension for queries/keys
D = 6 # embedding dimension for values
# Create sample tensors for forward pass
queries = torch.randn(B, L, H, E)
keys = torch.randn(B, S, H, E)
values = torch.randn(B, S, H, D)
attention_mask = None # Will use triangular causal mask if None
ARGS = {
'mask_flag': True,
'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
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type FullAttention — 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 FullAttention 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
|
| FullAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("8846b42edea92ff6") 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, FullAttention: 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 numpy as np
torch.manual_seed(0)
class TriangularCausalMask:
"""
Generates an upper-triangular binary mask to prevent the model from attending to future time-steps during
self-attention mechanism.
Args:
- B (int): Batch size.
- L (int): Sequence length.
- device (str or torch.device): Device on which to create the mask.
Attributes:
- mask (torch.Tensor): A tensor of shape (B, 1, L, L) representing the binary mask.
"""
def __init__(self, B, L, device='cpu'):
mask_shape = [B, 1, L, L]
with torch.no_grad():
self._mask = torch.triu(torch.ones(mask_shape, dtype=torch.bool), diagonal=1).to(device)
@property
def mask(self):
return self._mask
class FullAttention(nn.Module):
def __init__(self, mask_flag=True, scale=None, attention_dropout=0.1, output_attention=False):
"""
FullAttention module performs scaled dot-product attention between the input queries, keys, and values.
used in the original transformer
Args:
- mask_flag (bool): Whether to apply the attention mask. Default: True.
- scale (float or None): Scale factor for the attention scores. Default: None.
- attention_dropout (float): Dropout probability for the attention weights. Default: 0.1.
- output_attention (bool): Whether to return the attention scores. Default: False.
"""
super(FullAttention, self).__init__()
self.scale = scale
self.mask_flag = mask_flag
self.output_attention = output_attention
self.dropout = nn.Dropout(attention_dropout)
def forward(self, queries, keys, values, attn_mask):
B, L, H, E = queries.shape
_, S, _, D = values.shape
scale = self.scale or 1.0 / np.sqrt(E)
scores = torch.einsum('blhe,bshe->bhls', queries, keys)
if self.mask_flag:
if attn_mask is None:
attn_mask = TriangularCausalMask(B, L, device=queries.device)
scores.masked_fill_(attn_mask.mask, -np.inf)
A = self.dropout(torch.softmax(scale * scores, dim=-1))
V = torch.einsum('bhls,bshd->blhd', A, values)
if self.output_attention:
return (V.contiguous(), A)
else:
return (V.contiguous(), None)
# Prepare test inputs for FullAttention.forward()
B = 2 # batch size
L = 4 # sequence length (queries)
S = 4 # sequence length (keys/values)
H = 3 # number of heads
E = 5 # embedding dimension per head
D = 6 # value dimension per head
queries = torch.randn(B, L, H, E)
keys = torch.randn(B, S, H, E)
values = torch.randn(B, S, H, D)
attn_mask = None
ARGS = {
'mask_flag': True,
'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
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type FullAttention — 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 FullAttention 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
|
| FullAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("8842a439c7ec814d") 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, FullAttention: 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 tensorflow as tf
import math
from math import sqrt
# Set seed for reproducibility
tf.random.set_seed(0)
# Create minimal tensor inputs for the call method
B, L, H, E = 2, 4, 3, 5 # batch, length, heads, embedding_dim
S, D = 4, 6 # source_length, depth
# Create dummy queries, keys, values tensors
# queries shape: [B, L, H, E]
queries = tf.random.normal([B, L, H, E], dtype=tf.float32)
# keys shape: [B, S, H, E]
keys = tf.random.normal([B, S, H, E], dtype=tf.float32)
# values shape: [B, S, H, D]
values = tf.random.normal([B, S, H, D], dtype=tf.float32)
# Create the inputs tuple as expected by the call method
inputs = (queries, keys, values)
# Create attn_mask - can be None and will be auto-generated, but we can also provide one
attn_mask = None
# Define ARGS for FullAttention.__init__
ARGS = {
"mask_flag": True,
"factor": 5,
"scale": None,
"attention_dropout": 0.1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type FullAttention — 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 FullAttention 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
|
| Informer |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("1e94250aa40e5761") 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, Informer: 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 numpy as np
torch.manual_seed(0)
# Define stub classes for missing components
class TokenEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(TokenEmbedding, self).__init__()
self.embedding = nn.Linear(c_in, d_model)
def forward(self, x):
return self.embedding(x)
class PositionalEmbedding(nn.Module):
def __init__(self, d_model):
super(PositionalEmbedding, self).__init__()
self.d_model = d_model
def forward(self, x):
B, L, D = x.shape
return torch.zeros(B, L, self.d_model)
class TemporalEmbedding(nn.Module):
def __init__(self, d_model, embedding_type='fixed', frequency='h'):
super(TemporalEmbedding, self).__init__()
self.d_model = d_model
def forward(self, x):
B, L = x.shape[0], x.shape[1]
return torch.zeros(B, L, self.d_model)
class TimeFeatureEmbedding(nn.Module):
def __init__(self, d_model, frequency='h'):
super(TimeFeatureEmbedding, self).__init__()
self.d_model = d_model
def forward(self, x):
B, L = x.shape[0], x.shape[1]
return torch.zeros(B, L, self.d_model)
class FullAttention(nn.Module):
def __init__(self, mask_flag, factor, attention_dropout=0.1, output_attention=False):
super(FullAttention, self).__init__()
self.mask_flag = mask_flag
self.factor = factor
self.attention_dropout = attention_dropout
self.output_attention = output_attention
def forward(self, queries, keys, values, attention_mask):
B, L, H, D = queries.shape
_, S, _, _ = keys.shape
queries = queries.transpose(1, 2)
keys = keys.transpose(1, 2)
values = values.transpose(1, 2)
scores = torch.matmul(queries, keys.transpose(-2, -1)) / np.sqrt(D)
if attention_mask is not None:
scores = scores + attention_mask
attention = torch.softmax(scores, dim=-1)
out = torch.matmul(attention, values)
out = out.transpose(1, 2).contiguous()
return out, attention
class ProbSparseAttention(nn.Module):
def __init__(self, mask_flag, factor, attention_dropout=0.1, output_attention=False):
super(ProbSparseAttention, self).__init__()
self.mask_flag = mask_flag
self.factor = factor
self.attention_dropout = attention_dropout
self.output_attention = output_attention
def forward(self, queries, keys, values, attention_mask):
B, L, H, D = queries.shape
_, S, _, _ = keys.shape
queries = queries.transpose(1, 2)
keys = keys.transpose(1, 2)
values = values.transpose(1, 2)
scores = torch.matmul(queries, keys.transpose(-2, -1)) / np.sqrt(D)
if attention_mask is not None:
scores = scores + attention_mask
attention = torch.softmax(scores, dim=-1)
out = torch.matmul(attention, values)
out = out.transpose(1, 2).contiguous()
return out, attention
# Now define ARGS for BaseInformer (which appears to be the actual class, not "Informer")
ARGS = {
'enc_in': 7,
'dec_in': 7,
'c_out': 7,
'out_len': 24,
'factor': 5,
'd_model': 512,
'n_heads': 8,
'num_encoder_layers': 2,
'num_decoder_layers': 1,
'd_ff': 2048,
'dropout': 0.05,
'attention_type': 'prob',
'embedding_type': 'fixed',
'frequency': 'h',
'activation': 'gelu',
'output_attention': False,
'distil': True,
'mix_attention': 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 Informer — 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 Informer 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 |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("fe4e559b538b3ba0") 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
import torch.nn as nn
import math
torch.manual_seed(0)
ARGS = {
'd_model': 8,
'max_length': 32
}
- 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
|
| PositionalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("3ec0eb0ce028e761") 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 an nn.Module that takes:
# - d_model (int): dimensionality of vectors
# - max_len (int, optional): maximum sequence length, defaults to 5000
# The forward method expects input x with at least 2 dimensions
# where x.size(1) is the sequence length
# It returns pe[:, :x.size(1)], so we need a batch of sequences
# Create a small input tensor: (batch_size=2, seq_len=3, d_model=4)
x = torch.randn(2, 3, 4)
ARGS = {
"d_model": 4,
"max_len": 5000,
}
- 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
|
| PositionalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("c9eed2b60149c2b6") 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 tensorflow as tf
import numpy as np
import math
# Create a sample input tensor
# The function uses inputs.shape[1], so we need a tensor with at least 2 dimensions
sample_input = tf.constant(np.random.randn(2, 3, 4).astype(np.float32))
# Define arguments for PositionalEmbedding
ARGS = {
"d_model": 4,
"max_len": 5000
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — 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
|
| ProbAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("dc08cea57a2ab8c2") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| ProbAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("dbdb7d5a6c687629") 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, ProbAttention: 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 numpy as np
from math import sqrt
torch.manual_seed(0)
# Create small stand-in objects and tensors for ProbAttention initialization
B = 2 # batch size
H = 3 # number of heads
L_Q = 4 # query length
L_V = 5 # value length
D = 6 # dimension
# Build argument values for ProbAttention.__init__
mask_flag = True
factor = 5
scale = None
attention_dropout = 0.1
output_attention = False
ARGS = {
'mask_flag': mask_flag,
'factor': factor,
'scale': scale,
'attention_dropout': attention_dropout,
'output_attention': output_attention
}
- 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 ProbAttention — 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 ProbAttention 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
|
| ProbAttention |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("c438e9005b408fe1") 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, ProbAttention: 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 tensorflow as tf
import numpy as np
import math
# Create small test tensors
B = 2 # batch size
H = 3 # number of heads
L = 4 # query sequence length
S = 5 # key/value sequence length
D = 6 # dimension per head
# Create queries, keys, values with shapes (B, L, H, D), (B, S, H, D), (B, S, H, D)
queries = tf.random.normal((B, L, H, D), dtype=tf.float32)
keys = tf.random.normal((B, S, H, D), dtype=tf.float32)
values = tf.random.normal((B, S, H, D), dtype=tf.float32)
# Create the ProbAttention layer
ARGS = {
"mask_flag": True,
"factor": 5,
"scale": None,
"attention_dropout": 0.1
}
# Test the layer
prob_attn = tf.keras.layers.Layer()
prob_attn.__class__ = type('ProbAttention', (tf.keras.layers.Layer,), {
'__init__': lambda self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1: (
super(type(self), self).__init__(),
setattr(self, 'factor', factor),
setattr(self, 'scale', scale),
setattr(self, 'mask_flag', mask_flag),
setattr(self, 'dropout', tf.keras.layers.Dropout(attention_dropout))
)
})
# Alternative: Define the setup more simply
ARGS = {
"mask_flag": True,
"factor": 5,
"scale": None,
"attention_dropout": 0.1
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ProbAttention — 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 ProbAttention 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
|
| ProbAttention |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("9655ff6765e29f40") 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 numpy as np
from math import sqrt
class ProbMask:
def __init__(self, B, H, L, index, scores, device='cpu'):
_mask = torch.ones(L, scores.shape[-1], dtype=torch.bool).to(device).triu(1)
_mask_ex = _mask[None, None, :].expand(B, H, L, scores.shape[-1])
indicator = _mask_ex[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :].to(device)
self._mask = indicator.view(scores.shape).to(device)
@property
def mask(self):
return self._mask
class ProbAttention(nn.Module):
def __init__(self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1, output_attention=False):
super(ProbAttention, 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 _prob_QK(self, Q, K, sample_k, n_top):
B, H, L_K, E = K.shape
_, _, L_Q, _ = Q.shape
K_expand = K.unsqueeze(-3).expand(B, H, L_Q, L_K, E)
index_sample = torch.randint(L_K, (L_Q, sample_k))
K_sample = K_expand[:, :, torch.arange(L_Q).unsqueeze(1), index_sample, :]
Q_K_sample = torch.matmul(Q.unsqueeze(-2), K_sample.transpose(-2, -1)).squeeze(-2)
M = Q_K_sample.max(-1)[0] - torch.div(Q_K_sample.sum(-1), L_K)
M_top = M.topk(n_top, sorted=False)[1]
Q_reduce = Q[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], M_top, :]
Q_K = torch.matmul(Q_reduce, K.transpose(-2, -1))
return (Q_K, M_top)
def _get_initial_context(self, V, L_Q):
B, H, L_V, D = V.shape
if not self.mask_flag:
V_sum = V.mean(dim=-2)
contex = V_sum.unsqueeze(-2).expand(B, H, L_Q, V_sum.shape[-1]).clone()
else:
assert L_Q == L_V
contex = V.cumsum(dim=-2)
return contex
def _update_context(self, context_in, V, scores, index, L_Q, attn_mask):
B, H, L_V, D = V.shape
if self.mask_flag:
attn_mask = ProbMask(B, H, L_Q, index, scores, device=V.device)
scores.masked_fill_(attn_mask.mask, -np.inf)
attn = torch.softmax(scores, dim=-1)
context_in[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :] = torch.matmul(attn, V).type_as(context_in)
if self.output_attention:
attns = (torch.ones([B, H, L_V, L_V]) / L_V).type_as(attn).to(attn.device)
attns[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :] = attn
return (context_in, attns)
else:
return (context_in, None)
def forward(self, queries, keys, values, attn_mask):
B, L_Q, H, D = queries.shape
_, L_K, _, _ = keys.shape
queries = queries.transpose(2, 1)
keys = keys.transpose(2, 1)
values = values.transpose(2, 1)
U_part = self.factor * np.ceil(np.log(L_K)).astype('int').item()
u = self.factor * np.ceil(np.log(L_Q)).astype('int').item()
U_part = U_part if U_part < L_K else L_K
u = u if u < L_Q else L_Q
scores_top, index = self._prob_QK(queries, keys, sample_k=U_part, n_top=u)
scale = self.scale or 1.0 / sqrt(D)
if scale is not None:
scores_top = scores_top * scale
context = self._get_initial_context(values, L_Q)
context, attn = self._update_context(context, values, scores_top, index, L_Q, attn_mask)
return (context.transpose(2, 1).contiguous(), attn)
INIT_ARGS = {
'mask_flag': True,
'factor': 5,
'scale': None,
'attention_dropout': 0.1,
'output_attention': False
}
ARGS = {
'queries': torch.randn(2, 8, 3, 4),
'keys': torch.randn(2, 8, 3, 4),
'values': torch.randn(2, 8, 3, 4),
'attn_mask': None
}
if __name__ == '__main__':
model = ProbAttention(**INIT_ARGS)
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
- numpy, 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)
|
| ProbSparseAttention |
Ran ran on a synthesized input |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("927aac1e136e7bb9") 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 numpy as np
import math
def prob_mask(B, H, L, index, scores, device=torch.device('cpu')):
mask = torch.ones(L, scores.shape[-1], dtype=torch.bool, device=device).triu(1)
mask_ex = mask[None, None, :].expand(B, H, L, scores.shape[-1])
indicator = mask_ex[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :]
mask = indicator.view(scores.shape)
return mask
class ProbSparseAttention(nn.Module):
def __init__(self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1, output_attention=False):
super(ProbSparseAttention, self).__init__()
self.mask_flag = mask_flag
self.factor = factor
self.scale = scale
self.output_attention = output_attention
self.dropout = nn.Dropout(attention_dropout)
def forward(self, queries, keys, values, attention_mask):
B, L_Q, H, D = queries.shape
_, L_K, _, _ = keys.shape
queries = torch.transpose(queries, 2, 1)
keys = torch.transpose(keys, 2, 1)
values = torch.transpose(values, 2, 1)
U_part = int(self.factor * math.ceil(math.log(L_K)))
u = int(self.factor * math.ceil(math.log(L_Q)))
U_part = U_part if U_part < L_K else L_K
u = u if u < L_Q else L_Q
scores_top, index = self._prob_QK(queries, keys, sample_k=U_part, n_top=u)
scale = self.scale or 1.0 / math.sqrt(D)
if scale is not None:
scores_top = scores_top * scale
context = self._get_initial_context(values, L_Q)
context, attention = self._update_context(context, values, scores_top, index, L_Q, attention_mask)
return (context.transpose(2, 1).contiguous(), attention)
def _prob_QK(self, queries, keys, sample_k, n_top):
B, H, L_K, E = keys.shape
_, _, L_Q, _ = queries.shape
K_expand = keys.unsqueeze(-3).expand(B, H, L_Q, L_K, E)
index_sample = torch.randint(L_K, (L_Q, sample_k))
K_sample = K_expand[:, :, torch.arange(L_Q).unsqueeze(1), index_sample, :]
Q_K_sample = (queries.unsqueeze(-2) @ K_sample.transpose(-2, -1)).squeeze()
M = Q_K_sample.max(-1)[0] - torch.div(Q_K_sample.sum(-1), L_K)
M_top = M.topk(n_top, sorted=False)[1]
Q_reduce = queries[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], M_top, :]
Q_K = Q_reduce @ keys.transpose(-2, -1)
return (Q_K, M_top)
def _get_initial_context(self, values, L_Q):
B, H, L_V, D = values.shape
if not self.mask_flag:
V_mean = values.mean(dim=-2)
context = V_mean.unsqueeze(-2).expand(B, H, L_Q, V_mean.size(-1)).clone()
else:
assert L_Q == L_V
context = values.cumsum(dim=-2)
return context
def _update_context(self, context, values, scores, index, L_Q, attention_mask):
B, H, L_V, D = values.shape
if self.mask_flag:
attention_mask = prob_mask(B, H, L_Q, index, scores, device=values.device)
scores.masked_fill_(attention_mask, -np.inf)
attention = torch.softmax(scores, dim=-1)
context[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :] = (attention @ values).type_as(context)
if self.output_attention:
attentions = (torch.ones(B, H, L_V, L_V) / L_V).type_as(attention)
attentions[torch.arange(B)[:, None, None], torch.arange(H)[None, :, None], index, :] = attention
return (context, attentions)
return (context, None)
INIT_ARGS = {
'mask_flag': True,
'factor': 5,
'scale': None,
'attention_dropout': 0.1,
'output_attention': False
}
ARGS = {
'queries': torch.randn(2, 8, 2, 4),
'keys': torch.randn(2, 8, 2, 4),
'values': torch.randn(2, 8, 2, 4),
'attention_mask': None
}
if __name__ == '__main__':
model = ProbSparseAttention(**INIT_ARGS)
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
- numpy, 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)
|
| SelfAttentionDistil |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("e591315794c8447c") 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, SelfAttentionDistil: 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)
# SelfAttentionDistil.__init__ takes one parameter: c_in
# This is the input channel dimension for Conv1d
# Looking at the forward method:
# - x comes in with shape (batch, seq_len, c_in)
# - permute(0, 2, 1) makes it (batch, c_in, seq_len)
# - Conv1d expects (batch, c_in, seq_len)
# - All operations preserve c_in channels
c_in = 8
ARGS = {
"c_in": c_in,
}
- 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 SelfAttentionDistil — 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 SelfAttentionDistil 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
|
| TemporalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("f439ed4caab077e1") 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, TemporalEmbedding: 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 math
torch.manual_seed(0)
ARGS = {
'd_model': 16,
'embedding_type': 'fixed',
'frequency': 'h'
}
- 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 TemporalEmbedding — 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 TemporalEmbedding 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
|
| TemporalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("691256d926053823") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| TemporalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("563ef8125c8457b9") 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, TemporalEmbedding: 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 = {
'd_model': 8,
'embed_type': 'fixed',
'freq': 'Sec'
}
- 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 TemporalEmbedding — 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 TemporalEmbedding 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
|
| TemporalEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("546a049e0d4f1276") 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, TemporalEmbedding: 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 tensorflow as tf
import numpy as np
import math
# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)
# Create a tiny batch of temporal indices
# inputs shape: (batch_size, sequence_length, temporal_features)
# temporal_features: [month, day, weekday, hour, minute]
batch_size = 2
sequence_length = 3
temporal_features = 5
inputs = np.array([
[[1, 5, 2, 10, 0], # sample 1, timestep 1
[1, 5, 2, 11, 0], # sample 1, timestep 2
[1, 5, 2, 12, 0]], # sample 1, timestep 3
[[3, 15, 4, 18, 0], # sample 2, timestep 1
[3, 15, 4, 19, 0], # sample 2, timestep 2
[3, 15, 4, 20, 0]] # sample 2, timestep 3
], dtype=np.int32)
inputs_tensor = tf.constant(inputs)
ARGS = {
'd_model': 4,
'embed_type': 'fixed',
'data': 'ETTh'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TemporalEmbedding — 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 TemporalEmbedding 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
|
| TimeFeatureEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("868faa6c4998dccc") 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, TimeFeatureEmbedding: 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 = {
'd_model': 8,
'frequency': 'h'
}
- 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 TimeFeatureEmbedding — 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 TimeFeatureEmbedding 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
|
| TimeFeatureEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("4734d6da3f0addcd") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| TimeFeatureEmbedding |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("af7ecc176fa05a0c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; 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
# TimeFeatureEmbedding expects:
# - d_model: output dimension
# - embed_type: not used in the code
# - freq: determines input dimension via freq_map
INIT_ARGS = {
'd_model': 8,
'embed_type': 'timeF',
'freq': 'h' # freq='h' maps to d_inp=4
}
# The forward method expects x with shape [..., d_inp]
# where d_inp = freq_map[freq] = 4 for freq='h'
# Let's use batch_size=2, seq_len=5, d_inp=4
ARGS = {
'x': torch.randn(2, 5, 4) # (batch, seq_len, d_inp=4)
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, 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)
|
| TokenEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
martinwhl/Informer-PyTorch-Lightning/models/informer/model.py code served (permissive licence) · get_code("b27ba004293a09c9") 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, TokenEmbedding: 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)
# TokenEmbedding.__init__ takes c_in and d_model as parameters
# c_in: number of input channels (features)
# d_model: dimension of the model (output channels)
c_in = 4 # input channels
d_model = 8 # model 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 TokenEmbedding — 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 TokenEmbedding 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
|
| TokenEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
larsbentsen/fftransformer/models/Informer.py pointer only (licence: NONE) · get_code("5757cd5e31be6f96") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, larsbentsen/fftransformer when it was checked. 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. |
| TokenEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("ffff571f678f5301") 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, TokenEmbedding: 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 = {
'c_in': 4,
'd_model': 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 TokenEmbedding — 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 TokenEmbedding 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
|
| TokenEmbedding |
Ran ran on a synthesized input · constructed an object; no result was computed |
tianhai123/Informer-Tensorflow/models/model.py code served (permissive licence) · get_code("db188ee2de158d14") 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, TokenEmbedding: 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 tensorflow as tf
import numpy as np
# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)
# Define ARGS dict with all parameters for TokenEmbedding
ARGS = {
'c_in': 3, # input channels/features
'd_model': 4 # output model dimension
}
# Verify the setup by creating an instance and a test input
if __name__ == "__main__":
from tensorflow.keras.layers import LeakyReLU
# Create the layer
layer = tf.keras.layers.Layer
# Create a small test input tensor
# Shape: (batch_size=2, sequence_length=5, c_in=3)
test_input = tf.constant(np.random.randn(2, 5, 3).astype(np.float32))
# This verifies the input shape matches c_in
assert test_input.shape[-1] == ARGS['c_in']
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type TokenEmbedding — 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 TokenEmbedding 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
|
| TokenEmbedding |
Ran ran on a synthesized input |
zhouhaoyi/Informer2020/models/model.py code served (permissive licence) · get_code("1f7e24f214af5f8f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 8) 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
class TokenEmbedding(nn.Module):
def __init__(self, c_in, d_model):
super(TokenEmbedding, self).__init__()
padding = 1 if torch.__version__ >= '1.5.0' else 2
self.tokenConv = nn.Conv1d(in_channels=c_in, out_channels=d_model, kernel_size=3, padding=padding, padding_mode='circular')
for m in self.modules():
if isinstance(m, nn.Conv1d):
nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='leaky_relu')
def forward(self, x):
x = self.tokenConv(x.permute(0, 2, 1)).transpose(1, 2)
return x
INIT_ARGS = {
'c_in': 4,
'd_model': 8,
}
ARGS = {
'x': torch.randn(2, 3, 4),
}
if __name__ == '__main__':
model = TokenEmbedding(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 8) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| TriangularCausalMask |
Ran ran on a synthesized input · constructed an object; no result was computed |
AndrzejMiskow/TradeAI/prediction_service/transformers/models.py code served (permissive licence) · get_code("fc6e01b035a3c754") 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, TriangularCausalMask: 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)
# TriangularCausalMask takes three parameters: B (batch size), L (sequence length), and device
# B: batch size (int)
# L: sequence length (int)
# device: torch device (str or torch.device)
ARGS = {
'B': 2,
'L': 4,
'device': 'cpu'
}
- 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 TriangularCausalMask — 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 TriangularCausalMask 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
|