SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.14730 · ICLR · 2023

A Time Series is Worth 64 Words: Long-term Forecasting with Transformers

Yuqi Nie, Nam Nguyen, Phanwadee Sinthong, Jayant Kalagnanam

arXiv · PDF · Open in the Atlas

Code that ran

17 of 30 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 16 have no contract verdict; 1 failure of our instrument; 13 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2211.14730.json · badge: /api/ran/2211.14730.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
arclab-mit/sw-driver-forecaster community (classifier label)
classifier basis not recorded on the link
6 ran · 3 no recorded run
timeseriesAI/tsai community (classifier label)
classifier basis not recorded on the link
4 ran · 3 no recorded run
romilbert/samformer community
Papers with Code archive
3 ran · 0 no recorded run
yuqinie98/patchtst marked official in Papers with Code
Papers with Code archive
2 ran · 6 no recorded run
WenjieDu/PyPOTS community
Papers with Code archive
2 ran · 0 no recorded run
thuml/iTransformer community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
Flatten_Head Ran
ran on a synthesized input · constructed an object; no result was computed
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("924854bdeb316b83")
How it ran

Ran 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, Flatten_Head: 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 = {
    "individual": True,
    "n_vars": 3,
    "nf": 8,
    "target_window": 5,
    "head_dropout": 0.1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Flatten_Head — 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 Flatten_Head output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
PatchEmbedding Ran
ran on a synthesized input
WenjieDu/PyPOTS/pypots/nn/modules/patchtst/layers.py
code served (permissive licence) · get_code("9bb8f29c7ede97fa")
How it ran

Ran 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 (6, 5, 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

# Import the classes
from torch.nn import Module, Linear, Dropout, ReplicationPad1d

class PositionalEncoding(nn.Module):
    """The original positional-encoding module for Transformer."""

    def __init__(self, d_hid: int, n_positions: int=1000):
        super().__init__()
        pe = torch.zeros(n_positions, d_hid, requires_grad=False).float()
        position = torch.arange(0, n_positions).float().unsqueeze(1)
        div_term = (torch.arange(0, d_hid, 2).float() * -(torch.log(torch.tensor(10000)) / d_hid)).exp()
        pe[:, 0::2] = torch.sin(position * div_term)
        pe[:, 1::2] = torch.cos(position * div_term)
        pe = pe.unsqueeze(0)
        self.register_buffer('pos_table', pe)

    def forward(self, x: torch.Tensor, dim: int=1, return_only_pos: bool=False) -> torch.Tensor:
        pos_enc = self.pos_table[:, :x.size(dim)].clone().detach()
        if return_only_pos:
            return pos_enc
        x_with_pos = x + pos_enc
        return x_with_pos

class PatchEmbedding(nn.Module):

    def __init__(self, d_model, patch_size, patch_stride, padding, dropout, positional_embedding=True):
        super().__init__()
        self.patch_size = patch_size
        self.patch_stride = patch_stride
        self.padding_patch_layer = nn.ReplicationPad1d((0, padding))
        self.value_embedding = nn.Linear(patch_size, d_model, bias=False)
        if positional_embedding:
            self.positional_embedding = PositionalEncoding(d_model)
        else:
            self.positional_embedding = None
        self.dropout = nn.Dropout(dropout)

    def forward(self, x):
        x = self.padding_patch_layer(x)
        x = x.unfold(dimension=-1, size=self.patch_size, step=self.patch_stride)
        x = x.reshape(x.shape[0] * x.shape[1], x.shape[2], x.shape[3])
        x = self.value_embedding(x)
        if self.positional_embedding is not None:
            x = self.positional_embedding(x)
        x = self.dropout(x)
        return x

# Setup arguments
INIT_ARGS = {
    'd_model': 8,
    'patch_size': 4,
    'patch_stride': 2,
    'padding': 1,
    'dropout': 0.1,
    'positional_embedding': True,
}

# Input tensor: batch_size=2, num_features=3, sequence_length=12
# After padding with 1 on the right: (2, 3, 13)
# After unfold with size=4, step=2: (2, 3, 5, 4)
# After reshape: (6, 5, 4) -> (batch*features, num_patches, patch_size)
# value_embedding expects last dim = patch_size = 4
ARGS = {
    'x': torch.randn(2, 3, 12),
}

if __name__ == '__main__':
    model = PatchEmbedding(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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 (6, 5, 8) — shape (6, 5, 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)
PositionalEncoding Ran
ran on a synthesized input
WenjieDu/PyPOTS/pypots/nn/modules/patchtst/layers.py
code served (permissive licence) · get_code("492dd85148f4f725")
How it ran

Ran 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 torch.nn as nn

# Parameters for __init__
INIT_ARGS = {
    'd_hid': 8,
    'n_positions': 16,
}

# Parameters for forward (the computation method)
ARGS = {
    'x': torch.randn(2, 10, 8),  # batch_size=2, seq_len=10, d_hid=8
    'dim': 1,
    'return_only_pos': False,
}

# Construct and call
if __name__ == '__main__':
    model = nn.PositionalEncoding(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
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 — 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)
RevIN Ran
ran on a synthesized input · constructed an object; no result was computed
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("a7b56d4ba3fc4e05")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, RevIN: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

ARGS = {
    'num_features': 4,
    'eps': 1e-05,
    'affine': True,
    'subtract_last': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RevIN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RevIN output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
RevIN Ran
ran on a synthesized input
romilbert/samformer/samformer_pytorch/samformer/samformer.py
code served (permissive licence) · get_code("299bb76dee459375")
How it ran

Ran 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
from torch import nn

class RevIN(nn.Module):
    """
    Reversible Instance Normalization (RevIN) https://openreview.net/pdf?id=cGDAkQo1C0p
    https://github.com/ts-kim/RevIN
    """

    def __init__(self, num_features: int, eps=1e-05, affine=True):
        """
        :param num_features: the number of features or channels
        :param eps: a value added for numerical stability
        :param affine: if True, RevIN has learnable affine parameters
        """
        super(RevIN, self).__init__()
        self.num_features = num_features
        self.eps = eps
        self.affine = affine
        if self.affine:
            self._init_params()

    def forward(self, x, mode: str):
        if mode == 'norm':
            self._get_statistics(x)
            x = self._normalize(x)
        elif mode == 'denorm':
            x = self._denormalize(x)
        else:
            raise NotImplementedError
        return x

    def _init_params(self):
        self.affine_weight = nn.Parameter(torch.ones(self.num_features))
        self.affine_bias = nn.Parameter(torch.zeros(self.num_features))

    def _get_statistics(self, x):
        dim2reduce = tuple(range(1, x.ndim - 1))
        self.mean = torch.mean(x, dim=dim2reduce, keepdim=True).detach()
        self.stdev = torch.sqrt(torch.var(x, dim=dim2reduce, keepdim=True, unbiased=False) + self.eps).detach()

    def _normalize(self, x):
        x = x - self.mean
        x = x / self.stdev
        if self.affine:
            x = x * self.affine_weight
            x = x + self.affine_bias
        return x

    def _denormalize(self, x):
        if self.affine:
            x = x - self.affine_bias
            x = x / (self.affine_weight + self.eps * self.eps)
        x = x * self.stdev
        x = x + self.mean
        return x


INIT_ARGS = {
    'num_features': 4,
    'eps': 1e-05,
    'affine': True
}

ARGS = {
    'x': torch.randn(2, 3, 4),
    'mode': 'norm'
}

if __name__ == '__main__':
    model = RevIN(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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)
SAMFormerArchitecture Ran
ran on a synthesized input
romilbert/samformer/samformer_pytorch/samformer/samformer.py
code served (permissive licence) · get_code("d4cfb7ce9eee3e29")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# INIT_ARGS for SAMFormerArchitecture.__init__
INIT_ARGS = {
    'num_channels': 5,
    'seq_len': 12,
    'hid_dim': 8,
    'pred_horizon': 6,
    'use_revin': True
}

# ARGS for SAMFormerArchitecture.forward
# Input shape: (batch_size, num_channels, seq_len)
x = torch.randn(2, 5, 12)

ARGS = {
    'x': x,
    'flatten_output': True
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
bold_best Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/plots.py
code served (permissive licence) · get_code("19fa411f0e0b205f")
How it ran

Ran 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 ndarray, ndim 1, dtype family float, shape (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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Create small 1D numpy arrays for testing
X = np.array([0.5, 0.3, 0.8, 0.2])
X_ref = np.array([0.4, 0.5, 0.7, 0.3])

ARGS = {
    'X': X,
    'X_ref': X_ref,
    'higher_better': False,
    'bold_ref_too': False,
    'bold_equal': False,
    'use_abs': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
forecast_error Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/benchmark.py
code served (permissive licence) · get_code("5b63e338d455f44a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function forecast_error expects:
# - y_true: a 2D tensor where we index [:, h-1]
# - y_pred: a 2D tensor where we index [:, h-1]
# - h: an integer representing the horizon (must be >= 1)

# Create tensors with shape (batch_size=2, sequence_length=4)
y_true = torch.randn(2, 4)
y_pred = torch.randn(2, 4)

# h must be a valid index (1 to 4 for 0-indexed access to positions 0-3)
h = 2

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
    "h": 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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_classified_columns Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/utils.py
code served (permissive licence) · get_code("0c4835b27ac129bc")
How it ran

Ran 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 DataFrame. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import pandas as pd

# Create a sample DataFrame with numeric columns
df = pd.DataFrame({
    'column1': [1.5, 2.3, 3.7, 4.2, 5.1],
    'column2': [10, 20, 30, 40, 50],
    'column3': [100, 200, 300, 400, 500]
})

# Define thresholds as a dict mapping column names to lists of tuples (bin ranges)
thresholds = {
    'column1': [(0, 2.5), (2.5, 5.0), (5.0, 10.0)],
    'column2': [(0, 25), (25, 50), (50, 100)]
}

# Define activity_levels as a dict mapping column names to lists of category labels
activity_levels = {
    'column1': ['Low', 'Medium', 'High'],
    'column2': ['Low', 'Medium', 'High']
}

ARGS = {
    'df': df,
    'thresholds': thresholds,
    'activity_levels': activity_levels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_idxs_per_solar_activity_level Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/utils.py
code served (permissive licence) · get_code("82677ec6b39c1fda")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample data with solar activity measurements
# data[:, 0] contains the solar activity values
np.random.seed(0)
data = np.random.uniform(0, 100, size=(10, 5))

# Create thresholds for solar activity levels
thresholds = [25.0, 50.0, 75.0]

ARGS = {
    "data": data,
    "thresholds": thresholds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_lds_kernel_window Ran
ran on a synthesized input
timeseriesAI/tsai/tsai/callback/core.py
code served (permissive licence) · get_code("2bbd4bfccd060fed")
How it ran

Ran 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 ndarray, ndim 1, dtype family float, shape (9,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.ndimage import gaussian_filter1d
from scipy.signal.windows import triang

ARGS = {
    'lds_kernel': 'gaussian',
    'lds_ks': 9,
    'lds_sigma': 1.0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (9,) — shape (9,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
inverse_scale_values_below_threshold Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/metrics.py
code served (permissive licence) · get_code("b28a75229f1ab34d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (6,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor with some values below and above a threshold
tensor = torch.tensor([0.5, 1.5, 0.3, 2.0, 0.8, 1.2], dtype=torch.float32)

# Define threshold, lower_bound, and upper_bound
threshold = 1.0
lower_bound = 0.0
upper_bound = 10.0

ARGS = {
    "tensor": tensor,
    "threshold": threshold,
    "lower_bound": lower_bound,
    "upper_bound": upper_bound,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (6,) — shape (6,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_installed Ran
ran on a synthesized input
timeseriesAI/tsai/tsai/imports.py
code served (permissive licence) · get_code("9b5013e73b919955")
How it ran

Ran 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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import importlib

# The function is_installed takes a module_name string parameter
# and checks if that module is installed using importlib.util.find_spec
# We need to provide a string that represents a module name

ARGS = {
    "module_name": "torch"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
nb_name_to_py Ran
ran on a synthesized input
timeseriesAI/tsai/tsai/export.py
code served (permissive licence) · get_code("bc18aebf89319382")
How it ran

Ran 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 str. 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

def nb_name_to_py(nb_name):
    return str(nb_name).replace('.ipynb', '.py')

# The function takes a notebook name and replaces the .ipynb extension with .py
# It converts the input to string and performs a simple string replacement
# A valid input is any object that can be converted to a string containing '.ipynb'

ARGS = {
    'nb_name': 'my_notebook.ipynb'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
percent_forecast_error Ran
ran on a synthesized input
arclab-mit/sw-driver-forecaster/swdf/benchmark.py
code served (permissive licence) · get_code("984b7d634fd80a20")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (2,) 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 numpy as np

torch.manual_seed(0)

# Create small test tensors
# y_true and y_pred should have shape (batch_size, time_steps)
# where batch_size=2 and time_steps=4
batch_size = 2
time_steps = 4

y_true = torch.randn(batch_size, time_steps)
y_pred = torch.randn(batch_size, time_steps)

# h is the forecast horizon (1-indexed), must be between 1 and time_steps
h = 2

# epsilon is the default parameter with value 1e-08
epsilon = 1e-08

ARGS = {
    "y_true": y_true,
    "y_pred": y_pred,
    "h": h,
    "epsilon": epsilon
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
scaled_dot_product_attention Ran
ran; our contract draft was wrong, not the code
romilbert/samformer/samformer_pytorch/samformer/samformer.py
code served (permissive licence) · get_code("21d036b82013b9f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 3, dtype family float, shape (2, 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 numpy as np

torch.manual_seed(0)

# Construct tiny tensors for attention mechanism
# query: (batch, seq_len, dim)
# key: (batch, seq_len, dim)
# value: (batch, seq_len, dim)
batch_size = 2
seq_len_q = 3
seq_len_k = 3
dim = 4

query = torch.randn(batch_size, seq_len_q, dim)
key = torch.randn(batch_size, seq_len_k, dim)
value = torch.randn(batch_size, seq_len_k, dim)

# Optional attention mask (boolean mask, same shape as attention weights)
attn_mask = torch.ones(seq_len_q, seq_len_k, dtype=torch.bool)

# Dropout probability
dropout_p = 0.1

# Causal flag
is_causal = False

# Scale factor (None means it will be computed from query dim)
scale = None

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "attn_mask": attn_mask,
    "dropout_p": dropout_p,
    "is_causal": is_causal,
    "scale": scale,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
to_local_time Ran
ran on a synthesized input
timeseriesAI/tsai/tsai/imports.py
code served (permissive licence) · get_code("aa4127e924213cb3")
How it ran

Ran 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 str. 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 time

# to_local_time takes a Unix timestamp (float/int) and a time format string
# It calls time.strftime(time_format, time.localtime(t))
# time.localtime(t) converts Unix timestamp to struct_time
# time.strftime formats it according to the format string

# Create a valid Unix timestamp (current time or any reasonable past time)
current_timestamp = time.time()

ARGS = {
    't': current_timestamp,
    'time_format': '%Y-%m-%d %H:%M:%S'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Model Not yet run
unverified (harvested, no recorded run)
thuml/iTransformer/model/iTransformer.py
code served (permissive licence) · get_code("d1fa32a7b86667ec")
How it ran

no invocation recorded.

PatchTST_backbone Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("23dc6db25b8074c9")
How it ran

no invocation recorded.

TSTEncoder Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("935deedae3555ede")
How it ran

no invocation recorded.

TSTEncoderLayer Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("ce09df21971e2a59")
How it ran

no invocation recorded.

TSTiEncoder Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("583948f80990e843")
How it ran

no invocation recorded.

_MultiheadAttention Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("db1784f091843709")
How it ran

no invocation recorded.

_ScaledDotProductAttention Not yet run
unverified (harvested, no recorded run)
yuqinie98/patchtst/PatchTST_supervised/layers/PatchTST_backbone.py
code served (permissive licence) · get_code("0caa47b3b62aada4")
How it ran

no invocation recorded.

custom_doc_links Not yet run
unverified (harvested, no recorded run)
timeseriesAI/tsai/tsai/_nbdev.py
code served (permissive licence) · get_code("c00f1d9594b0678a")
How it ran

no invocation recorded.

euclidean_distance_dict Not yet run
unverified (harvested, no recorded run)
arclab-mit/sw-driver-forecaster/swdf/utils.py
code served (permissive licence) · get_code("d0e642167565d536")
How it ran

no invocation recorded.

plot_predictions_performance Not yet run
unverified (harvested, no recorded run)
arclab-mit/sw-driver-forecaster/swdf/plots.py
code served (permissive licence) · get_code("b462a292e7a87197")
How it ran

no invocation recorded.

prepare_LDS_weights Not yet run
unverified (harvested, no recorded run)
timeseriesAI/tsai/tsai/callback/core.py
code served (permissive licence) · get_code("c2f4fa1e770585ff")
How it ran

no invocation recorded.

prepare_tensor_to_forecast_histogram Not yet run
unverified (harvested, no recorded run)
arclab-mit/sw-driver-forecaster/swdf/plots.py
code served (permissive licence) · get_code("5ca0c802e78ccded")
How it ran

no invocation recorded.

py_last_saved Not yet run
unverified (harvested, no recorded run)
timeseriesAI/tsai/tsai/imports.py
code served (permissive licence) · get_code("eafe0504957d2813")
How it ran

no invocation recorded.

Also present in other papers' code

Of 30 samples lifted from this paper's linked repositories, 30 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 8 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 7 later) and 22 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
custom_doc_links 9 other papers
9 dated earlier
1403.6652 (2014-03)
DeepWalk: Online Learning of Social Representations
1604.07143 (2016-04)
Neural Random Forests
1812.08693 (2018-12)
An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine Translation
and 6 more not named here
RevIN
brick of this paper's assembly: helper
7 other papers
1 dated earlier, 6 later · 6 only as an assembly brick
2205.13504 (2022-05)
Are Transformers Effective for Time Series Forecasting?
2402.05956 (2024-02)
Pathformer: Multi-scale Transformers with Adaptive Pathways for Time Series Forecasting
2407.00502 (2024-07)
Deep Frequency Derivative Learning for Non-stationary Time Series Forecasting
and 4 more not named here
RevIN
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later · 2 only as an assembly brick
2109.04553 (2021-09)
Is Attention Better Than Matrix Decomposition?
2212.08151 (2022-12)
First De-Trend then Attend: Rethinking Attention for Time-Series Forecasting
2401.02236 (2024-01)
U-Mixer: An Unet-Mixer Architecture with Stationarity Correction for Time Series Forecasting
and 1 more not named here
_ScaledDotProductAttention
brick of this paper's assembly: model
4 other papers
4 later · 2 only as an assembly brick
2502.16284 (2025-02)
MolSpectra: Pre-training 3D Molecular Representation with Multi-modal Energy Spectra
2602.00596 (2026-02)
Kernelized Edge Attention: Addressing Semantic Attention Blurring in Temporal Graph Neural Networks
2602.01585 (2026-02)
A Lightweight Sparse Interaction Network for Time Series Forecasting
and 1 more not named here
_MultiheadAttention
brick of this paper's assembly: model
2 other papers
2 later · 2 only as an assembly brick
2602.01585 (2026-02)
A Lightweight Sparse Interaction Network for Time Series Forecasting
2603.10410 (2026-03)
Effective Dataset Distillation for Spatio-Temporal Forecasting with Bi-dimensional Compression
Flatten_Head
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2603.10410 (2026-03)
Effective Dataset Distillation for Spatio-Temporal Forecasting with Bi-dimensional Compression
TSTEncoder
brick of this paper's assembly: model
1 other paper
1 later
2603.10410 (2026-03)
Effective Dataset Distillation for Spatio-Temporal Forecasting with Bi-dimensional Compression
TSTiEncoder
brick of this paper's assembly: model
1 other paper
1 later
2603.10410 (2026-03)
Effective Dataset Distillation for Spatio-Temporal Forecasting with Bi-dimensional Compression

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We propose an efficient design of Transformer-based models for multivariate time series forecasting and self-supervised representation learning. It is based on two key components: (i) segmentation of time series into subseries-level patches which are served as input tokens to Transformer; (ii) channel-independence where each channel contains a single univariate time series that shares the same embedding and Transformer weights across all the series. Patching design naturally has three-fold benefit: local semantic information is retained in the embedding; computation and memory usage of the attention maps are quadratically reduced given the same look-back window; and the model can attend longer history. Our channel-independent patch time series Transformer (PatchTST) can improve the long-term forecasting accuracy significantly when compared with that of SOTA Transformer-based models. We also apply our model to self-supervised pretraining tasks and attain excellent fine-tuning performance, which outperforms supervised training on large datasets. Transferring of masked pre-trained representation on one dataset to others also produces SOTA forecasting accuracy.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2211.14730")
get_code_for_paper("2211.14730")
have("2211.14730")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2211.14730.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2211.14730.svg)](https://syntology.ai/paper/2211.14730)

Connect an agent — have() is free.