SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.00645 · NeurIPS · 2021

Global Filter Networks for Image Classification

Yongming Rao, Wenliang Zhao, Jiwen Lu, Jie Zhou, Zheng Zhu

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 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/2107.00645.json · badge: /api/ran/2107.00645.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
raoyongming/GFNet canonical (classifier label)
classifier basis: classifier_2025
5 ran · 0 no recorded run
dslisleedh/MLP_based_models-tensorflow2 community
Papers with Code archive
1 ran · 4 no recorded run
FunctionStatusWhere it lives
Block Ran
ran on a synthesized input · constructed an object; no result was computed
raoyongming/GFNet/gfnet.py
code served (permissive licence) · get_code("dff7a9ab8c3f50a9")
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, Block: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from timm.models.layers import DropPath
import math

torch.manual_seed(0)

ARGS = {
    "dim": 4,
    "mlp_ratio": 4.0,
    "drop": 0.0,
    "drop_path": 0.0,
    "act_layer": nn.GELU,
    "norm_layer": nn.LayerNorm,
    "h": 14,
    "w": 8,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Block — 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 Block 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
FFN Ran
ran on a synthesized input
dslisleedh/MLP_based_models-tensorflow2/gfnet.py
pointer only (licence: NONE) · get_code("51372e4eff26857f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/MLP_based_models-tensorflow2 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.

GFNet Ran
ran on a synthesized input · constructed an object; no result was computed
raoyongming/GFNet/gfnet.py
code served (permissive licence) · get_code("81d69a569925b1bd")
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, GFNet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from functools import partial

torch.manual_seed(0)

ARGS = {
    'img_size': 224,
    'patch_size': 16,
    'in_chans': 3,
    'num_classes': 10,
    'embed_dim': 64,
    'depth': 2,
    'mlp_ratio': 4.0,
    'representation_size': None,
    'uniform_drop': False,
    'drop_rate': 0.0,
    'drop_path_rate': 0.1,
    'norm_layer': partial(nn.LayerNorm, eps=1e-6),
    'dropcls': 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GFNet — 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 GFNet 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
GlobalFilter Ran
ran on a synthesized input · constructed an object; no result was computed
raoyongming/GFNet/gfnet.py
code served (permissive licence) · get_code("71e71e6d0819c701")
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, GlobalFilter: 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)

# GlobalFilter.__init__ parameters:
# - dim: feature dimension
# - h: height of frequency domain (default 14)
# - w: width of frequency domain (default 8)

# GlobalFilter.forward parameters:
# - x: input tensor of shape (B, N, C) where N = a*b (flattened spatial)
# - spatial_size: optional tuple (a, b) for spatial dimensions

# Set up dimensions
dim = 4
h = 14
w = 8

# Create input tensor
# B=2 (batch), N=9 (spatial: 3x3), C=4 (channels)
B = 2
a = 3
b = 3
N = a * b
C = dim

x = torch.randn(B, N, C, dtype=torch.float32)

# spatial_size can be None (will infer from sqrt(N)) or explicit tuple
spatial_size = (a, b)

ARGS = {
    'dim': dim,
    'h': h,
    'w': w,
}
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 GlobalFilter — 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 GlobalFilter 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
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
raoyongming/GFNet/gfnet.py
code served (permissive licence) · get_code("32f151ed58e2d272")
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 dict. 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 model that has the attributes accessed by checkpoint_filter_fn
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        # patch_embed.proj needs to be a Conv2d with weight shape (O, I, H, W)
        self.patch_embed = nn.Module()
        self.patch_embed.proj = nn.Conv2d(3, 16, kernel_size=4, stride=4)
        
        # pos_embed is accessed for shape comparison
        # Create a position embedding: (1, num_patches + 1, embed_dim)
        # num_patches = (224/4)^2 = 56^2 = 3136, plus 1 for cls token
        self.pos_embed = torch.randn(1, 3137, 768)

model = MinimalModel()

# Create a state_dict with position embedding that needs resizing
# Old pos_embed has different spatial dimensions
old_pos_embed = torch.randn(1, 577, 768)  # 24x24 grid + 1 cls token = 577

state_dict = {
    'pos_embed': old_pos_embed,
    'patch_embed.proj.weight': torch.randn(16, 3, 4, 4),  # Already 4D, won't be reshaped
    'other_param': torch.randn(10, 20)
}

ARGS = {
    'state_dict': state_dict,
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
resize_pos_embed Ran
ran; our contract draft was wrong, not the code
raoyongming/GFNet/gfnet.py
code served (permissive licence) · get_code("0b1994de5d8cd41f")
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 (1, 17, 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 math

torch.manual_seed(0)

# Create position embeddings
# posemb shape: (batch, num_tokens, embed_dim)
# For a ViT-like model with class token + grid tokens
# Old grid: 3x3 = 9 tokens, plus 1 class token = 10 total
batch_size = 1
old_grid_size = 3
old_num_grid_tokens = old_grid_size * old_grid_size  # 9
old_num_tokens = 1 + old_num_grid_tokens  # 10 (class token + grid)
embed_dim = 4

posemb = torch.randn(batch_size, old_num_tokens, embed_dim)

# New position embeddings target shape
# New grid: 4x4 = 16 tokens, plus 1 class token = 17 total
new_grid_size = 4
new_num_grid_tokens = new_grid_size * new_grid_size  # 16
new_num_tokens = 1 + new_num_grid_tokens  # 17 (class token + grid)

posemb_new = torch.randn(batch_size, new_num_tokens, embed_dim)

ARGS = {
    "posemb": posemb,
    "posemb_new": posemb_new,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 (1, 17, 4) — shape (1, 17, 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
Droppath Not yet run
unverified (harvested, no recorded run)
dslisleedh/MLP_based_models-tensorflow2/gfnet.py
pointer only (licence: NONE) · get_code("61598b6c0f788e3c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/MLP_based_models-tensorflow2 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. No invocation recorded.

GFBlock Not yet run
unverified (harvested, no recorded run)
dslisleedh/MLP_based_models-tensorflow2/gfnet.py
pointer only (licence: NONE) · get_code("92b83ac006fb234c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/MLP_based_models-tensorflow2 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. No invocation recorded.

GFNet Not yet run
unverified (harvested, no recorded run)
dslisleedh/MLP_based_models-tensorflow2/gfnet.py
pointer only (licence: NONE) · get_code("c28756e840db40ee")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/MLP_based_models-tensorflow2 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. No invocation recorded.

GlobalFilterLayer Not yet run
unverified (harvested, no recorded run)
dslisleedh/MLP_based_models-tensorflow2/gfnet.py
pointer only (licence: NONE) · get_code("84d40e6af39d20fc")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, dslisleedh/MLP_based_models-tensorflow2 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. No invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 8 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
resize_pos_embed 8 other papers
1 dated earlier, 7 later
2106.00515 (2021-06)
KVT: k-NN Attention for Boosting Vision Transformers
2108.01390 (2021-08)
Evo-ViT: Slow-Fast Token Evolution for Dynamic Vision Transformer
2112.05230 (2021-12)
Injecting Semantic Concepts into End-to-End Image Captioning
and 5 more not named here
checkpoint_filter_fn 7 other papers
1 dated earlier, 6 later
2106.00515 (2021-06)
KVT: k-NN Attention for Boosting Vision Transformers
2108.01390 (2021-08)
Evo-ViT: Slow-Fast Token Evolution for Dynamic Vision Transformer
2112.05230 (2021-12)
Injecting Semantic Concepts into End-to-End Image Captioning
and 4 more not named here

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

Recent advances in self-attention and pure multi-layer perceptrons (MLP) models for vision have shown great potential in achieving promising performance with fewer inductive biases. These models are generally based on learning interaction among spatial locations from raw data. The complexity of self-attention and MLP grows quadratically as the image size increases, which makes these models hard to scale up when high-resolution features are required. In this paper, we present the Global Filter Network (GFNet), a conceptually simple yet computationally efficient architecture, that learns long-term spatial dependencies in the frequency domain with log-linear complexity. Our architecture replaces the self-attention layer in vision transformers with three key operations: a 2D discrete Fourier transform, an element-wise multiplication between frequency-domain features and learnable global filters, and a 2D inverse Fourier transform. We exhibit favorable accuracy/complexity trade-offs of our models on both ImageNet and downstream tasks. Our results demonstrate that GFNet can be a very competitive alternative to transformer-style models and CNNs in efficiency, generalization ability and robustness. Code is available at https://github.com/raoyongming/GFNet.

For agents

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

get_harvested_code_for_paper("2107.00645")
get_code_for_paper("2107.00645")
have("2107.00645")

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

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

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

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

Connect an agent — have() is free.