SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.09741 · 2022

Visual Attention Network

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 1 failure of our instrument; 0 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/2202.09741.json · badge: /api/ran/2202.09741.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
Visual-Attention-Network/VAN-Classification canonical (classifier label)
classifier basis not recorded on the link
1 ran · 0 no recorded run
shkarupa-alex/tfvan community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
EMalagoli92/VAN-Classification-TensorFlow community (classifier label)
classifier basis not recorded on the link
2 ran · 0 no recorded run
FunctionStatusWhere it lives
convert_name Ran
ran on a synthesized input
shkarupa-alex/tfvan/convert_weights.py
code served (permissive licence) · get_code("365afdb1239780d8")
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
import torch.nn as nn

torch.manual_seed(0)

# The function 'convert_name' takes a single parameter 'name' which is a string
# It performs string replacements on the name
# No complex objects needed - just a string parameter

ARGS = {
    'name': 'layer_0/depthwise_kernel:0'
}
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
convert_weight Ran
ran on a synthesized input
shkarupa-alex/tfvan/convert_weights.py
code served (permissive licence) · get_code("250a0be2cff73866")
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 4, dtype family float, shape (1, 1, 1, 5) 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)

# Test case 1: layer_scale weight (1D tensor)
weight_layer_scale = torch.randn(5)
name_layer_scale = 'module.layer_scale'

# Test case 2: dwconv weight (4D tensor)
weight_dwconv = torch.randn(3, 4, 5, 6)
name_dwconv = 'module.dwconv.weight'

# Test case 3: spatial_gating_unit conv0 weight (4D tensor)
weight_spatial_conv0 = torch.randn(3, 4, 5, 6)
name_spatial_conv0 = 'module.spatial_gating_unit.conv0.weight'

# Test case 4: spatial_gating_unit conv_spatial weight (4D tensor)
weight_spatial_conv_spatial = torch.randn(3, 4, 5, 6)
name_spatial_conv_spatial = 'module.spatial_gating_unit.conv_spatial.weight'

# Test case 5: generic 4D weight (not dwconv or spatial_gating_unit)
weight_4d = torch.randn(7, 8, 9, 10)
name_4d = 'module.conv.weight'

# Test case 6: generic 2D weight
weight_2d = torch.randn(11, 12)
name_2d = 'module.linear.weight'

# Test case 7: other weight (should pass through unchanged)
weight_other = torch.randn(13, 14, 15)
name_other = 'module.bias'

# Use the first test case as the primary ARGS
ARGS = {
    'weight': weight_layer_scale,
    'name': name_layer_scale
}
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 4, dtype family float, shape (1, 1, 1, 5) — shape (1, 1, 1, 5) 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
load_model_weights Ran
ran on a synthesized input
Visual-Attention-Network/VAN-Classification/models/van.py
code served (permissive licence) · get_code("07d3401919c8d206")
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 MinimalVAN. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal model that has the structure expected by load_model_weights
class MinimalVAN(nn.Module):
    def __init__(self):
        super().__init__()
        self.head = nn.Linear(768, 1000)
        self.features = nn.Linear(3, 768)
    
    def forward(self, x):
        x = self.features(x)
        x = self.head(x)
        return x

model = MinimalVAN()

# Create a mock checkpoint that would be returned by torch.hub.load_state_dict_from_url
# We need to mock this since we can't do actual network requests
checkpoint = {
    'state_dict': {
        'head.weight': torch.randn(1000, 768),
        'head.bias': torch.randn(1000),
        'features.weight': torch.randn(768, 3),
        'features.bias': torch.randn(768),
    }
}

# Mock torch.hub.load_state_dict_from_url to return our checkpoint
original_load = torch.hub.load_state_dict_from_url
def mock_load_state_dict_from_url(url, map_location='cpu', check_hash=True):
    return checkpoint
torch.hub.load_state_dict_from_url = mock_load_state_dict_from_url

arch = 'van_b0'
kwargs = {}

ARGS = {
    'model': model,
    'arch': arch,
    'kwargs': kwargs
}
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 MinimalVAN — a MinimalVAN output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalVAN 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
norm_cdf Ran
ran, honoured the contract we drafted
EMalagoli92/VAN-Classification-TensorFlow/van_classification_tensorflow/models/layers/utils.py
code served (permissive licence) · get_code("1e7a21b70e475e05")
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 float, 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 math

def norm_cdf(x):
    """Computes standard normal cumulative distribution."""
    return (1.0 + math.erf(x / math.sqrt(2.0))) / 2.0

# The function takes a single parameter x and applies math operations to it
# x can be a float, int, or any numeric type that supports division and math.erf

ARGS = {
    "x": 0.5
}
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 float, 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
preprocess_input Ran
ran on a synthesized input
shkarupa-alex/tfvan/tfvan/prep.py
code served (permissive licence) · get_code("5e6f2f4822f14d6f")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 3) 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 tensorflow as tf
import numpy as np

# Create a small input tensor with shape (batch=2, height=4, width=3, channels=3)
# This represents a batch of 2 RGB images of size 4x3
inputs = tf.constant(np.random.randint(0, 256, size=(2, 4, 3, 3), dtype=np.uint8), dtype=tf.uint8)

ARGS = {
    'inputs': inputs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
keras, numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) 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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
EMalagoli92/VAN-Classification-TensorFlow/van_classification_tensorflow/models/layers/utils.py
code served (permissive licence) · get_code("6fc63671bfbb6c99")
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 EagerTensor, ndim 2, dtype family float, shape (2, 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 tensorflow as tf
import math

ARGS = {
    "shape": (2, 4),
    "mean": 0.0,
    "std": 1.0,
    "a": -2.0,
    "b": 2.0,
    "dtype": tf.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 4 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
norm_cdf 3 other papers
2 dated earlier, 1 later
1907.04433 (2019-07)
GluonCV and GluonNLP: Deep Learning in Computer Vision and Natural Language Processing
2103.15808 (2021-03)
CvT: Introducing Convolutions to Vision Transformers
2206.09959 (2022-06)
Global Context Vision Transformers
trunc_normal_ 2 other papers
1 dated earlier, 1 later
2103.15808 (2021-03)
CvT: Introducing Convolutions to Vision Transformers
2206.09959 (2022-06)
Global Context Vision Transformers

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

While originally designed for natural language processing tasks, the self-attention mechanism has recently taken various computer vision areas by storm. However, the 2D nature of images brings three challenges for applying self-attention in computer vision. (1) Treating images as 1D sequences neglects their 2D structures. (2) The quadratic complexity is too expensive for high-resolution images. (3) It only captures spatial adaptability but ignores channel adaptability. In this paper, we propose a novel linear attention named large kernel attention (LKA) to enable self-adaptive and long-range correlations in self-attention while avoiding its shortcomings. Furthermore, we present a neural network based on LKA, namely Visual Attention Network (VAN). While extremely simple, VAN surpasses similar size vision transformers(ViTs) and convolutional neural networks(CNNs) in various tasks, including image classification, object detection, semantic segmentation, panoptic segmentation, pose estimation, etc. For example, VAN-B6 achieves 87.8% accuracy on ImageNet benchmark and set new state-of-the-art performance (58.2 PQ) for panoptic segmentation. Besides, VAN-B2 surpasses Swin-T 4% mIoU (50.1 vs. 46.1) for semantic segmentation on ADE20K benchmark, 2.6% AP (48.8 vs. 46.2) for object detection on COCO dataset. It provides a novel method and a simple yet strong baseline for the community. Code is available at https://github.com/Visual-Attention-Network.

For agents

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

get_harvested_code_for_paper("2202.09741")
get_code_for_paper("2202.09741")
have("2202.09741")

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

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

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

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

Connect an agent — have() is free.