SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.06801 · NeurIPS · 2022

Peripheral Vision Transformer

Minsu Cho, Chong Luo, Juhong Min, Yucheng Zhao

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2206.06801.json · badge: /api/ran/2206.06801.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
juhongm999/pervit canonical (classifier label)
classifier basis: classifier_2025
5 ran · 3 no recorded run
FunctionStatusWhere it lives
CPE Ran
ran on a synthesized input
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("595177616e2ec587")
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 math

# INIT_ARGS: parameters for CPE.__init__(dim, k=3)
INIT_ARGS = {
    'dim': 8,
    'k': 3
}

# ARGS: parameters for CPE.forward(x)
# x should be shape (B, N, C) where N = side * side (perfect square)
# and C = dim from INIT_ARGS
B = 2
side = 4  # side length of the square spatial grid
N = side * side  # 16
C = INIT_ARGS['dim']  # 8

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

ARGS = {
    'x': x
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
einops, 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)
ConvolutionalStem Ran
ran on a synthesized input · constructed an object; no result was computed
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("76e33d2eb254ba85")
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, ConvolutionalStem: 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 einops.layers.torch import Rearrange

torch.manual_seed(0)

# The ConvolutionalStem.__init__ takes:
# - n_filter_list: list of integers representing channel counts
# - kernel_sizes: list of integers (default [3, 3, 3, 3])
# - strides: list of integers (default [2, 2, 2, 2])

# We need n_filter_list to have at least 2 elements (since it accesses n_filter_list[i+1])
# The number of conv layers is len(n_filter_list) - 1
# So we need len(kernel_sizes) = len(strides) = len(n_filter_list) - 1

# Let's create a small example with 4 layers (3 conv blocks)
# Input: 3 channels (RGB)
# Output: 256 channels
n_filter_list = [3, 64, 128, 256]
kernel_sizes = [3, 3, 3]
strides = [2, 2, 2]

ARGS = {
    "n_filter_list": n_filter_list,
    "kernel_sizes": kernel_sizes,
    "strides": strides,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ConvolutionalStem — 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 ConvolutionalStem 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
MPA Ran
ran on a synthesized input · constructed an object; no result was computed
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("e532ca1ef64395a5")
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, MPA: 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)

# MPA parameters
dim = 8
num_heads = 2
qkv_bias = False
qk_scale = None
attn_drop = 0.0
proj_drop = 0.0
norm_init = (0.5, 1.0)

# Create a small RPE tensor
# The forward method expects rpe to work with PeripheralPositionEncoding
# which expects input of shape (n_token, n_token, d) where n_token = side^2
# For a 4x4 grid (16 tokens), we need side=4, so n_token=16
# rpe should be (16, 16, 8) to match dim=8
side = 4
n_token = side * side
rpe = torch.randn(n_token, n_token, dim)

# Create input x: (batch, n_patches, dim)
# n_patches should be 16 (4x4 grid) to match rpe
batch_size = 2
x = torch.randn(batch_size, n_token, dim)

ARGS = {
    "dim": dim,
    "num_heads": num_heads,
    "qkv_bias": qkv_bias,
    "qk_scale": qk_scale,
    "attn_drop": attn_drop,
    "proj_drop": proj_drop,
    "norm_init": norm_init,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MPA — 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 MPA 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
Mlp Ran
ran on a synthesized input · constructed an object; no result was computed
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("7c8acca47b6cad85")
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, Mlp: 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 trunc_normal_

torch.manual_seed(0)

ARGS = {
    "in_features": 4,
    "hidden_features": 8,
    "out_features": 3,
    "act_layer": nn.GELU,
    "drop": 0.1,
}
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 Mlp — 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 Mlp 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
PeripheralPositionEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("0ca70ad6c00d5ee2")
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, PeripheralPositionEncoding: 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 einops import rearrange, repeat
import math

torch.manual_seed(0)

class PeripheralPositionEncoding(nn.Module):

    def __init__(self, num_heads, norm_init, kernel_size=3):
        super().__init__()
        in_channel = hid_channel = num_heads * 4
        out_channel = num_heads
        self.remove_pad = kernel_size // 2 * 2
        self.norm_init = norm_init
        self.pad_size = 0
        self.conv1 = nn.Conv2d(in_channel, hid_channel, kernel_size=kernel_size, stride=1, padding=self.pad_size, bias=True)
        self.conv2 = nn.Conv2d(hid_channel, out_channel, kernel_size=kernel_size, stride=1, padding=self.pad_size, bias=True)
        self.gn1 = nn.GroupNorm(hid_channel, hid_channel)
        self.gn2 = nn.GroupNorm(out_channel, out_channel)
        self.act1 = nn.ReLU(inplace=True)
        self.act2 = nn.Sigmoid()
        self.apply(self._init_weights)
        self.gn2.apply(self._peripheral_init)

    def _peripheral_init(self, m):
        if isinstance(m, nn.GroupNorm):
            nn.init.constant_(m.bias, self.norm_init[0])
            nn.init.constant_(m.weight, self.norm_init[1])

    def _init_weights(self, m):
        if isinstance(m, nn.Conv2d):
            nn.init.constant_(m.weight, 0.02)
            if m.bias is not None:
                nn.init.constant_(m.bias, 0.0)

    def forward(self, x):
        n_token = x.size(1)
        side = int(math.sqrt(n_token))
        x = rearrange(x, '(i j) (k l) d -> d i j k l', i=side, j=side, k=side, l=side)
        x = x[:, self.remove_pad:-self.remove_pad, self.remove_pad:-self.remove_pad, ...]
        x = rearrange(x, 'd i j k l -> (i j) d k l')
        x = self.conv1(x)
        x = self.gn1(x)
        x = self.act1(x)
        x = self.conv2(x)
        x = self.gn2(x)
        y = rearrange(x, '(i j) h k l -> () h (i j) (k l)', i=side - self.remove_pad * 2, j=side - self.remove_pad * 2)
        y = self.act2(y)
        return y

# Setup arguments
# num_heads=2 means in_channel=8, hid_channel=8, out_channel=2
# kernel_size=3 means remove_pad=2
# For forward: n_token must be a perfect square. Let's use side=4, so n_token=16
# x shape: (16, 16, 4) - (n_token, n_token, embedding_dim)

num_heads = 2
norm_init = [0.5, 1.0]
kernel_size = 3

# Create input tensor
# side = 4, so n_token = 16
# x shape should be (16, 16, 4)
x = torch.randn(16, 16, 4)

ARGS = {
    "num_heads": num_heads,
    "norm_init": norm_init,
    "kernel_size": kernel_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PeripheralPositionEncoding — 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 PeripheralPositionEncoding 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
Block Not yet run
unverified (harvested, no recorded run)
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("fcda8f3094f4d7c0")
How it ran

no invocation recorded.

OffsetGenerator Not yet run
unverified (harvested, no recorded run)
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("971b3af9504469b2")
How it ran

no invocation recorded.

VisionTransformer Not yet run
unverified (harvested, no recorded run)
juhongm999/pervit/model/pervit.py
code served (permissive licence) · get_code("65961eec77ac4145")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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-23.

Repositories linked to this paper

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

Abstract

Human vision possesses a special type of visual processing systems called peripheral vision. Partitioning the entire visual field into multiple contour regions based on the distance to the center of our gaze, the peripheral vision provides us the ability to perceive various visual features at different regions. In this work, we take a biologically inspired approach and explore to model peripheral vision in deep neural networks for visual recognition. We propose to incorporate peripheral position encoding to the multi-head self-attention layers to let the network learn to partition the visual field into diverse peripheral regions given training data. We evaluate the proposed network, dubbed PerViT, on ImageNet-1K and systematically investigate the inner workings of the model for machine perception, showing that the network learns to perceive visual data similarly to the way that human vision does. The performance improvements in image classification over the baselines across different model sizes demonstrate the efficacy of the proposed method.

For agents

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

get_harvested_code_for_paper("2206.06801")
get_code_for_paper("2206.06801")
have("2206.06801")

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

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

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

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

Connect an agent — have() is free.