SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.12740 · ICML · 2022

FEDformer: Frequency Enhanced Decomposed Transformer for Long-term Series Forecasting

Rong Jin, Tian Zhou, Ziqing Ma, Qingsong Wen, Xue Wang, Liang Sun

arXiv · PDF · Open in the Atlas

Code that ran

14 of 18 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 3 failures of our instrument; 4 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/2201.12740.json · badge: /api/ran/2201.12740.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
damo-di-ml/icml2022-fedformer community
Papers with Code archive
14 ran · 4 no recorded run
FunctionStatusWhere it lives
DataEmbedding_wo_pos Ran
ran on a synthesized input
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("dc9a21b6cd529603")
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 numpy as np
from scipy import stats

INIT_ARGS = {
    'c_in': 4,
    'd_model': 8,
    'embed_type': 'fixed',
    'freq': 'h',
    'dropout': 0.1
}

# Create input tensors for forward pass
batch_size = 2
seq_len = 3
x = torch.randn(batch_size, seq_len, INIT_ARGS['c_in'])
x_mark = torch.zeros(batch_size, seq_len, 4)  # For hour, weekday, day, month
x_mark[:, :, 3] = torch.randint(0, 24, (batch_size, seq_len))  # hour
x_mark[:, :, 2] = torch.randint(0, 7, (batch_size, seq_len))   # weekday
x_mark[:, :, 1] = torch.randint(1, 32, (batch_size, seq_len))  # day
x_mark[:, :, 0] = torch.randint(1, 13, (batch_size, seq_len))  # month

ARGS = {
    'x': x,
    'x_mark': x_mark
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, scipy, 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)
DecoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("67fefaba4d005397")
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, 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)

# Create minimal attention modules that satisfy the interface used in forward()
class MinimalAttention(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.d_model = d_model
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, q, k, v, attn_mask=None):
        # Must return tuple with first element being attention output
        output = self.linear(q)
        return (output, None)

# Instantiate attention modules
d_model = 4
c_out = 3
self_attention = MinimalAttention(d_model)
cross_attention = MinimalAttention(d_model)

ARGS = {
    'self_attention': self_attention,
    'cross_attention': cross_attention,
    'd_model': d_model,
    'c_out': c_out,
    'd_ff': 16,
    'moving_avg': 25,
    '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
EncoderLayer Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("a8b8631d0adecdfb")
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, 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
import math

torch.manual_seed(0)

# Build a minimal attention module that satisfies the usage in EncoderLayer.forward
class MinimalAttention(nn.Module):
    """Minimal attention module that returns (output, attention_weights)"""
    def __init__(self, d_model):
        super(MinimalAttention, self).__init__()
        self.d_model = d_model
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, query, key, value, attn_mask=None):
        # Simple passthrough attention that preserves shape
        output = self.linear(query)
        # Return tuple of (output, attention_weights)
        attn_weights = torch.ones(query.shape[0], query.shape[1], query.shape[1])
        return output, attn_weights

# Create attention module instance
d_model = 4
attention = MinimalAttention(d_model)

# Define all parameters for EncoderLayer
ARGS = {
    'attention': attention,
    'd_model': 4,
    'd_ff': 16,
    'moving_avg': 3,
    '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 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
FourierBlock Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("00fa3803caf170e8")
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, FourierBlock: 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)
np.random.seed(0)

ARGS = {
    'in_channels': 8,
    'out_channels': 8,
    'seq_len': 64,
    'modes': 16,
    'mode_select_method': 'random'
}
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 FourierBlock — 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 FourierBlock 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
FourierCrossAttention Ran
ran on a synthesized input
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("a864556299ca3b04")
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 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

# INIT_ARGS for FourierCrossAttention.__init__
INIT_ARGS = {
    'in_channels': 8,
    'out_channels': 8,
    'seq_len_q': 16,
    'seq_len_kv': 12,
    'modes': 4,
    'mode_select_method': 'lowest',
    'activation': 'tanh',
    'policy': 0
}

# ARGS for FourierCrossAttention.forward
# q, k, v shapes: (B, L, H, E)
# B=2 (batch), L=seq_len, H=num_heads (must match in_channels), E=head_dim (must match out_channels)
B = 2
L_q = 16  # must match seq_len_q
L_kv = 12  # must match seq_len_kv
H = 8  # must match in_channels
E = 8  # must match out_channels

q = torch.randn(B, L_q, H, E)
k = torch.randn(B, L_kv, H, E)
v = torch.randn(B, L_kv, H, E)
mask = None

ARGS = {
    'q': q,
    'k': k,
    'v': v,
    'mask': mask
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type 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)
FourierCrossAttentionW Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("53deda4694f6c41e")
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, FourierCrossAttentionW: 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 FourierCrossAttentionW(nn.Module):

    def __init__(self, in_channels, out_channels, seq_len_q, seq_len_kv, modes=16, activation='tanh', mode_select_method='random'):
        super(FourierCrossAttentionW, self).__init__()
        print('corss fourier correlation used!')
        self.in_channels = in_channels
        self.out_channels = out_channels
        self.modes1 = modes
        self.activation = activation

    def forward(self, q, k, v, mask):
        B, L, E, H = q.shape
        xq = q.permute(0, 3, 2, 1)
        xk = k.permute(0, 3, 2, 1)
        xv = v.permute(0, 3, 2, 1)
        self.index_q = list(range(0, min(int(L // 2), self.modes1)))
        self.index_k_v = list(range(0, min(int(xv.shape[3] // 2), self.modes1)))
        xq_ft_ = torch.zeros(B, H, E, len(self.index_q), device=xq.device, dtype=torch.cfloat)
        xq_ft = torch.fft.rfft(xq, dim=-1)
        for i, j in enumerate(self.index_q):
            xq_ft_[:, :, :, i] = xq_ft[:, :, :, j]
        xk_ft_ = torch.zeros(B, H, E, len(self.index_k_v), device=xq.device, dtype=torch.cfloat)
        xk_ft = torch.fft.rfft(xk, dim=-1)
        for i, j in enumerate(self.index_k_v):
            xk_ft_[:, :, :, i] = xk_ft[:, :, :, j]
        xqk_ft = torch.einsum('bhex,bhey->bhxy', xq_ft_, xk_ft_)
        if self.activation == 'tanh':
            xqk_ft = xqk_ft.tanh()
        elif self.activation == 'softmax':
            xqk_ft = torch.softmax(abs(xqk_ft), dim=-1)
            xqk_ft = torch.complex(xqk_ft, torch.zeros_like(xqk_ft))
        else:
            raise Exception('{} actiation function is not implemented'.format(self.activation))
        xqkv_ft = torch.einsum('bhxy,bhey->bhex', xqk_ft, xk_ft_)
        xqkvw = xqkv_ft
        out_ft = torch.zeros(B, H, E, L // 2 + 1, device=xq.device, dtype=torch.cfloat)
        for i, j in enumerate(self.index_q):
            out_ft[:, :, :, j] = xqkvw[:, :, :, i]
        out = torch.fft.irfft(out_ft / self.in_channels / self.out_channels, n=xq.size(-1)).permute(0, 3, 2, 1)
        return (out, None)

# Setup tiny tensors: batch=2, seq_len=8, embedding_dim=4, num_heads=3
batch = 2
seq_len_q = 8
seq_len_kv = 6
embedding_dim = 4
num_heads = 3
in_channels = 4
out_channels = 4
modes = 3

# Create q, k, v tensors with shape (batch, seq_len, embedding_dim, num_heads)
q = torch.randn(batch, seq_len_q, embedding_dim, num_heads)
k = torch.randn(batch, seq_len_kv, embedding_dim, num_heads)
v = torch.randn(batch, seq_len_kv, embedding_dim, num_heads)
mask = None

ARGS = {
    'in_channels': in_channels,
    'out_channels': out_channels,
    'seq_len_q': seq_len_q,
    'seq_len_kv': seq_len_kv,
    'modes': modes,
    'activation': 'tanh',
    'mode_select_method': 'random',
}
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 FourierCrossAttentionW — 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 FourierCrossAttentionW output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_filter Ran
ran, honoured the contract we drafted
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("ed5c803ead4a114e")
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 tuple, 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 numpy as np
from functools import partial

def phi_(x, coeffs, lb=None, ub=None):
    """Helper function to evaluate polynomial"""
    if lb is not None and ub is not None:
        x = np.asarray(x)
        mask = (x >= lb) & (x <= ub)
        result = np.zeros_like(x, dtype=float)
        result[mask] = np.polyval(coeffs, x[mask])
        return result
    return np.polyval(coeffs, x)

ARGS = {
    'k': 3,
    'base': 'legendre'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sympy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_phi_psi Ran
ran; our contract draft was wrong, not the code
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("f32036738135c8a8")
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 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 numpy as np
from functools import partial

# Construct valid arguments for get_phi_psi
ARGS = {
    'k': 3,
    'base': 'legendre'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sympy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
legendreDer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("4ef26472da51e3aa")
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
from scipy.special import eval_legendre

# The function legendreDer takes two parameters:
# k: an integer representing the order
# x: a value or array on which to evaluate the Legendre polynomials

# Looking at the function:
# - k is used in range(k-1, -1, -2) so it should be an integer
# - x is passed to eval_legendre which accepts scalars or arrays
# - The function iterates through odd/even indices based on k

# Create small test values
k = 5  # integer order
x = np.array([0.0, 0.5, -0.5, 1.0])  # small array of evaluation points

ARGS = {
    "k": k,
    "x": x
}
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 (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
moving_avg Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("9b305cbd3bf0b841")
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, moving_avg: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

torch.manual_seed(0)

# The moving_avg module takes kernel_size and stride as parameters
# It operates on input tensors of shape (batch, time_steps, features)
# Let's construct small but valid tensors

batch_size = 2
time_steps = 8
features = 4
kernel_size = 3
stride = 1

ARGS = {
    "kernel_size": kernel_size,
    "stride": stride,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type moving_avg — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a moving_avg output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
phi_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("a54c8c5c47c6a8b8")
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

# phi_ takes phi_c (polynomial coefficients), x (input array), and bounds lb, ub
# It creates a Polynomial from phi_c, evaluates it at x, and masks values outside [lb, ub]

# Create polynomial coefficients (small array)
phi_c = np.array([1.0, 2.0, 0.5])

# Create input array with values in and out of bounds
x = np.array([0.2, 0.5, 0.8, 1.5])

# Define bounds
lb = 0.0
ub = 1.0

ARGS = {
    "phi_c": phi_c,
    "x": x,
    "lb": lb,
    "ub": ub,
}
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
series_decomp Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("9864006bda240f6b")
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, series_decomp: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

torch.manual_seed(0)

# Define ARGS dict with all parameters for series_decomp.__init__
ARGS = {
    'kernel_size': 3
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type series_decomp — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a series_decomp output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
series_decomp_multi Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("12650d107f081cab")
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, series_decomp_multi: 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 = {
    "kernel_size": [3, 5, 7],
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type series_decomp_multi — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a series_decomp_multi 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
sparseKernelFT1d Ran
ran on a synthesized input · constructed an object; no result was computed
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("167914376110f2b0")
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, sparseKernelFT1d: 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)

# Parameters for sparseKernelFT1d
k = 3  # kernel size parameter
alpha = 5  # modes1 - number of modes to keep in Fourier space
c = 2  # channel multiplier
nl = 1  # not used in forward, but part of signature

# Create input tensor: (B, N, c, k)
# B=2 (batch), N=4 (sequence length), c=2 (channels), k=3 (kernel)
x = torch.randn(2, 4, 2, 3, dtype=torch.float32)

ARGS = {
    'k': k,
    'alpha': alpha,
    'c': c,
    'nl': nl,
    'initializer': None,
}
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 sparseKernelFT1d — 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 sparseKernelFT1d 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
MWT_CZ1d Not yet run
unverified (harvested, no recorded run)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("d5092e91107264e0")
How it ran

no invocation recorded.

Model Not yet run
unverified (harvested, no recorded run)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("9c15c2f9350a0c0f")
How it ran

no invocation recorded.

MultiWaveletCross Not yet run
unverified (harvested, no recorded run)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("4c47351a1d531cdc")
How it ran

no invocation recorded.

MultiWaveletTransform Not yet run
unverified (harvested, no recorded run)
damo-di-ml/icml2022-fedformer/models/FEDformer.py
code served (permissive licence) · get_code("bc90983dfb0d79aa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 18 samples lifted from this paper's linked repositories, 18 carry a function identity and 0 do not. Of the 18 distinct functions with an identity, 11 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 10 later) and 7 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
phi_
brick of this paper's assembly: helper
24 other papers
24 later · 1 only as an assembly brick
2205.08897 (2022-05)
FiLM: Frequency improved Legendre Memory Model for Long-term Time Series Forecasting
2304.05206 (2023-04)
The Capacity and Robustness Trade-off: Revisiting the Channel Independent Strategy for Multivariate Time Series Forecasting
2305.13036 (2023-05)
Disentangling Structured Components: Towards Adaptive, Interpretable and Scalable Time Series Forecasting
and 21 more not named here
get_phi_psi
brick of this paper's assembly: helper
23 other papers
23 later · 1 only as an assembly brick
2205.08897 (2022-05)
FiLM: Frequency improved Legendre Memory Model for Long-term Time Series Forecasting
2305.13036 (2023-05)
Disentangling Structured Components: Towards Adaptive, Interpretable and Scalable Time Series Forecasting
2307.01616 (2023-07)
SageFormer: Series-Aware Framework for Long-term Multivariate Time Series Forecasting
and 20 more not named here
legendreDer
brick of this paper's assembly: helper
23 other papers
23 later · 1 only as an assembly brick
2205.08897 (2022-05)
FiLM: Frequency improved Legendre Memory Model for Long-term Time Series Forecasting
2305.13036 (2023-05)
Disentangling Structured Components: Towards Adaptive, Interpretable and Scalable Time Series Forecasting
2307.01616 (2023-07)
SageFormer: Series-Aware Framework for Long-term Multivariate Time Series Forecasting
and 20 more not named here
series_decomp
brick of this paper's assembly: helper
15 other papers
1 dated earlier, 14 later · 10 only as an assembly brick
2106.13008 (2021-06)
Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting
2205.13504 (2022-05)
Are Transformers Effective for Time Series Forecasting?
2206.04038 (2022-06)
Scaleformer: Iterative Multi-scale Refining Transformers for Time Series Forecasting
and 12 more not named here
series_decomp_multi
brick of this paper's assembly: helper
3 other papers
3 later · 1 only as an assembly brick
2206.04038 (2022-06)
Scaleformer: Iterative Multi-scale Refining Transformers for Time Series Forecasting
2212.08151 (2022-12)
First De-Trend then Attend: Rethinking Attention for Time-Series Forecasting
2402.05956 (2024-02)
Pathformer: Multi-scale Transformers with Adaptive Pathways for Time Series Forecasting
moving_avg
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2212.08151 (2022-12)
First De-Trend then Attend: Rethinking Attention for Time-Series Forecasting
2402.05956 (2024-02)
Pathformer: Multi-scale Transformers with Adaptive Pathways for Time Series Forecasting
DataEmbedding_wo_pos
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2106.13008 (2021-06)
Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting
DecoderLayer
brick of this paper's assembly: model
1 other paper
1 later
2206.04038 (2022-06)
Scaleformer: Iterative Multi-scale Refining Transformers for Time Series Forecasting
EncoderLayer
brick of this paper's assembly: model
1 other paper
1 later
2206.04038 (2022-06)
Scaleformer: Iterative Multi-scale Refining Transformers for Time Series Forecasting
FourierCrossAttention
brick of this paper's assembly: model
1 other paper
1 later
2510.19710 (2025-10)
SEMPO: Lightweight Foundation Models for Time Series Forecasting
get_filter
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2504.20858 (2025-04)
Chaos Meets Attention: Transformers for Large-Scale Dynamical Prediction

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

Although Transformer-based methods have significantly improved state-of-the-art results for long-term series forecasting, they are not only computationally expensive but more importantly, are unable to capture the global view of time series (e.g. overall trend). To address these problems, we propose to combine Transformer with the seasonal-trend decomposition method, in which the decomposition method captures the global profile of time series while Transformers capture more detailed structures. To further enhance the performance of Transformer for longterm prediction, we exploit the fact that most time series tend to have a sparse representation in well-known basis such as Fourier transform, and develop a frequency enhanced Transformer. Besides being more effective, the proposed method, termed as Frequency Enhanced Decomposed Transformer (FEDformer), is more efficient than standard Transformer with a linear complexity to the sequence length. Our empirical studies with six benchmark datasets show that compared with state-of-the-art methods, FEDformer can reduce prediction error by 14.8% and 22.6% for multivariate and univariate time series, respectively. Code is publicly available at https://github.com/MAZiqing/FEDformer.

For agents

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

get_harvested_code_for_paper("2201.12740")
get_code_for_paper("2201.12740")
have("2201.12740")

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

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

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

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

Connect an agent — have() is free.