SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Yang_Attentive_Mask_CLIP_ICCV_2023_paper · ICCV · 2023

Attentive Mask CLIP

Fangyun Wei, Houwen Peng, Han Hu, Yifan Yang, Yuqing Yang, Huiqiang Jiang, Lili Qiu, Xinyang Jiang, Yixuan Wei, Yin Wang, Weiquan Huang

Code that ran

15 of 18 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 6 have no contract verdict; 8 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/Yang_Attentive_Mask_CLIP_ICCV_2023_paper.json · badge: /api/ran/Yang_Attentive_Mask_CLIP_ICCV_2023_paper.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
microsoft/A-CLIP canonical (classifier label)
classifier basis: census
15 ran · 3 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/A-CLIP/main_linear.py
code served (permissive licence) · get_code("131a82fd65128218")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# output: logits/scores tensor of shape (batch_size, num_classes)
output = torch.randn(batch_size, num_classes)

# target: class indices tensor of shape (batch_size,)
target = torch.tensor([1, 3])

# topk: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 list, ndim 2, dtype family float — a list 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
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/A-CLIP/eval_zeroshot.py
pointer only (licence: MIT); the stored copy get_code serves, from KishoreP1/DetailCLIP, is pointer only (licence: NONE) · get_code("2e59707d16d21473")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KishoreP1/DetailCLIP, and GitHub detected no licence in that repository 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.

accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/A-CLIP/utils.py
code served (permissive licence) · get_code("085a09050f4f41dc")
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 list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# output: logits tensor of shape (batch_size, num_classes)
# The function calls output.topk(), so it needs to be a 2D tensor
output = torch.randn(batch_size, num_classes)

# target: class indices of shape (batch_size,)
# The function calls target.size(0) and target.reshape(1, -1)
target = torch.tensor([0, 2])

# topk: tuple of k values to compute accuracy for
topk = (1, 2)

ARGS = {
    "output": output,
    "target": target,
    "topk": topk,
}
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 list, ndim 2, dtype family float — a list 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
basic_clean Ran
ran; our contract draft was wrong, not the code
microsoft/A-CLIP/tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("98f385d847636a3e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, and GitHub detected no licence in that repository 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.

cal_simsiam_loss Ran
ran on a synthesized input
microsoft/A-CLIP/losses.py
code served (permissive licence) · get_code("19b7968607a56955")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors with distinct dimensions for p and z
# p and z should have shape (batch_size, feature_dim)
batch_size = 2
feature_dim = 4

p = torch.randn(batch_size, feature_dim)
z = torch.randn(batch_size, feature_dim)

version = 'simplified'

ARGS = {
    'p': p,
    'z': z,
    'version': version
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 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
forward_attn Ran
ran on a synthesized input
microsoft/A-CLIP/models.py
code served (permissive licence) · get_code("23fba458344296e3")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class AttentionModule(nn.Module):
    def __init__(self, dim, num_heads):
        super().__init__()
        self.num_heads = num_heads
        self.scale = (dim // num_heads) ** -0.5
        self.qkv = nn.Linear(dim, dim * 3)
        self.proj = nn.Linear(dim, dim)
        self.attn_drop = nn.Dropout(0.1)
        self.proj_drop = nn.Dropout(0.1)
    
    def forward_attn(self, x):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        attn = q @ k.transpose(-2, -1) * self.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return (x, attn.detach())

# Create model instance
dim = 8
num_heads = 2
model = AttentionModule(dim, num_heads)

# Create input tensor: (batch_size, num_tokens, channels)
x = torch.randn(2, 5, 8)

ARGS = {
    'self': model,
    'x': x
}
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 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
forward_block Ran
ran on a synthesized input
microsoft/A-CLIP/models.py
code served (permissive licence) · get_code("7f1e03897db3889f")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleNorm(nn.Module):
    def forward(self, x):
        return x / (x.abs().max() + 1e-8)

class SimpleDropPath(nn.Module):
    def forward(self, x):
        return x

class SimpleAttn(nn.Module):
    def __init__(self, dim, num_heads=2):
        super().__init__()
        self.num_heads = num_heads
        self.scale = (dim // num_heads) ** -0.5
        self.qkv = nn.Linear(dim, dim * 3)
        self.attn_drop = nn.Dropout(0.0)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(0.0)
    
    def forward(self, x):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        attn = q @ k.transpose(-2, -1) * self.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return (x, attn.detach())

class SimpleMLP(nn.Module):
    def __init__(self, dim):
        super().__init__()
        self.fc = nn.Linear(dim, dim)
    
    def forward(self, x):
        return self.fc(x)

class SimpleBlock(nn.Module):
    def __init__(self, dim=4, num_heads=2):
        super().__init__()
        self.norm1 = SimpleNorm()
        self.norm2 = SimpleNorm()
        self.attn = SimpleAttn(dim, num_heads)
        self.mlp = SimpleMLP(dim)
        self.drop_path = SimpleDropPath()
    
    def forward_attn(self, x):
        B, N, C = x.shape
        qkv = self.attn.qkv(x).reshape(B, N, 3, self.attn.num_heads, C // self.attn.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        attn = q @ k.transpose(-2, -1) * self.attn.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.attn.proj(x)
        x = self.attn.proj_drop(x)
        return (x, attn.detach())
    
    def forward_block(self, x):
        attn_x, attn = self.forward_attn(self.norm1(x))
        x = x + self.drop_path(attn_x)
        x = x + self.drop_path(self.mlp(self.norm2(x)))
        return (x, attn)

block = SimpleBlock(dim=4, num_heads=2)
x = torch.randn(2, 3, 4)

ARGS = {
    'self': block,
    'x': x
}
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 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
get_att_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/A-CLIP/models.py
pointer only (licence: MIT); the stored copy get_code serves, from KishoreP1/DetailCLIP, is pointer only (licence: NONE) · get_code("f8278dbfe57c1b58")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KishoreP1/DetailCLIP, and GitHub detected no licence in that repository 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.

get_downstream_dataset Ran
ran on a synthesized input
microsoft/A-CLIP/datasets.py
code served (permissive licence) · get_code("f4d9f26124e665f4")
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 FileListDataset. 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 os
import numpy as np
import torch
from torchvision import transforms
from unittest.mock import MagicMock, patch
import tempfile

torch.manual_seed(0)

# Create temporary directory for mock data
temp_dir = tempfile.mkdtemp()

# Create mock numpy arrays for filelist dataset
mock_images_array = np.array([
    os.path.join(temp_dir, 'img_0.jpg'),
    os.path.join(temp_dir, 'img_1.jpg')
])
mock_labels_array = np.array([0, 1])

# Save mock numpy files
images_path = os.path.join(temp_dir, 'train_images.npy')
labels_path = os.path.join(temp_dir, 'train_labels.npy')
np.save(images_path, mock_images_array)
np.save(labels_path, mock_labels_array)

# Create mock image files
from PIL import Image
for i in range(2):
    img = Image.new('RGB', (4, 3), color=(i*50, i*100, i*150))
    img.save(os.path.join(temp_dir, f'img_{i}.jpg'))

# Define catalog with different dataset types
catalog = {
    'imagefolder_dataset': {
        'type': 'imagefolder',
        'path': temp_dir,
        'train': 'train',
        'test': 'test'
    },
    'cifar10': {
        'type': 'special',
        'path': temp_dir,
    },
    'cifar100': {
        'type': 'special',
        'path': temp_dir,
    },
    'stl10': {
        'type': 'special',
        'path': temp_dir,
    },
    'mnist': {
        'type': 'special',
        'path': temp_dir,
    },
    'filelist_dataset': {
        'type': 'filelist',
        'path': temp_dir,
        'train': 'train',
        'test': 'test'
    },
    'clevr_counts': {
        'type': 'filelist',
        'path': temp_dir,
        'train': 'train',
        'test': 'test'
    }
}

# Create simple transform
transform = transforms.Compose([
    transforms.ToTensor(),
])

# Mock the torchvision datasets to avoid downloads
with patch('torchvision.datasets.ImageFolder') as mock_imagefolder, \
     patch('torchvision.datasets.CIFAR10') as mock_cifar10, \
     patch('torchvision.datasets.CIFAR100') as mock_cifar100, \
     patch('torchvision.datasets.STL10') as mock_stl10, \
     patch('torchvision.datasets.MNIST') as mock_mnist:
    
    mock_imagefolder.return_value = MagicMock()
    mock_cifar10.return_value = MagicMock()
    mock_cifar100.return_value = MagicMock()
    mock_stl10.return_value = MagicMock()
    mock_mnist.return_value = MagicMock()

ARGS = {
    'catalog': catalog,
    'name': 'filelist_dataset',
    'is_train': True,
    'transform': transform
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FileListDataset — a FileListDataset output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_pairs Ran
ran; our contract draft was wrong, not the code
microsoft/A-CLIP/tokenizer.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 set. 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

torch.manual_seed(0)

# The function get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
mean_per_class Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
microsoft/A-CLIP/eval_zeroshot.py
pointer only (licence: MIT); the stored copy get_code serves, from KishoreP1/DetailCLIP, is pointer only (licence: NONE) · get_code("f0eb8193f86d363b")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KishoreP1/DetailCLIP, and GitHub detected no licence in that repository 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.

pil_loader Ran
ran, honoured the contract we drafted
microsoft/A-CLIP/datasets.py
code served (permissive licence) · get_code("41dbe0d4c6e1d565")
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 Image. 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 tempfile
import os
from PIL import Image

# Create a temporary directory and a small test image
temp_dir = tempfile.mkdtemp()
test_image_path = os.path.join(temp_dir, "test_image.jpg")

# Create a small RGB image and save it
test_image = Image.new('RGB', (4, 3), color=(255, 0, 0))
test_image.save(test_image_path, 'JPEG')

ARGS = {
    'path': test_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
train Ran
ran on a synthesized input
microsoft/A-CLIP/main_linear.py
code served (permissive licence) · get_code("9c147228c1764edd")
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 dict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.optim as optim
import time

torch.manual_seed(0)

# Create a minimal model that accepts images and outputs logits
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 10)  # 4-dim input -> 10-class output
    
    def forward(self, x):
        return self.fc(x)

# Create a minimal train loader (list of (images, targets) tuples)
train_loader = [
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
]

# Create model, criterion, and optimizer
model = MinimalModel()
criterion = nn.CrossEntropyLoss()
optimizer = optim.SGD(model.parameters(), lr=0.01)

# Create args object with required attributes
class Args:
    def __init__(self):
        self.gpu = None  # CPU only
        self.print_freq = 1  # Print every batch

args = Args()

# Define ARGS dict with all parameters for the train function
ARGS = {
    'train_loader': train_loader,
    'model': model,
    'criterion': criterion,
    'optimizer': optimizer,
    'epoch': 1,
    'args': args,
}
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 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
validate Ran
ran on a synthesized input
microsoft/A-CLIP/main_linear.py
code served (permissive licence) · get_code("3e77a098344bd525")
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 dict. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 accepts images and produces output
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 10)  # 10 classes for top-5 accuracy
    
    def forward(self, x):
        return self.fc(x)

# Create a minimal val_loader (list of tuples with images and targets)
val_loader = [
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
    (torch.randn(2, 4), torch.randint(0, 10, (2,))),
]

# Create model and criterion
model = MinimalModel()
criterion = nn.CrossEntropyLoss()

# Create args object with required attributes
class Args:
    def __init__(self):
        self.gpu = None
        self.print_freq = 1

args = Args()

ARGS = {
    'val_loader': val_loader,
    'model': model,
    'criterion': criterion,
    'args': args,
}
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 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
whitespace_clean Ran
ran; our contract draft was wrong, not the code
microsoft/A-CLIP/tokenizer.py
pointer only (licence: MIT); the stored copy get_code serves, from ltpwy/MSCI, is pointer only (licence: NONE) · get_code("9542161e9640b858")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ltpwy/MSCI, and GitHub detected no licence in that repository 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.

get_model Not yet run
unverified (harvested, no recorded run)
microsoft/A-CLIP/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from camma-public/peskavlp, is pointer only (licence: NONE) · get_code("2ec9ac675733a9ac")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from camma-public/peskavlp, and GitHub detected no licence in that repository 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.

unwrap_model Not yet run
unverified (harvested, no recorded run)
microsoft/A-CLIP/utils.py
code served (permissive licence) · get_code("2bf62c0287050bdd")
How it ran

no invocation recorded.

yfcc_loader Not yet run
unverified (harvested, no recorded run)
microsoft/A-CLIP/datasets.py
code served (permissive licence) · get_code("3c4992378ca3d4d0")
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 17 distinct functions with an identity, 14 are also present in other papers whose code we hold (12 with at least one paper dated earlier, 0 the same month, 10 later) and 3 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
get_pairs 258 other papers
41 dated earlier, 150 later, 66 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
whitespace_clean 231 other papers
27 dated earlier, 141 later, 62 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 228 more not named here
basic_clean 218 other papers
27 dated earlier, 128 later, 62 same year, order not determinable, 1 undated · 4 only as an assembly brick
1901.07441 (2019-01)
PadChest: A large chest x-ray image dataset with multi-label annotated reports
2107.06383 (2021-07)
How Much Can CLIP Benefit Vision-and-Language Tasks?
2108.10904 (2021-08)
SimVLM: Simple Visual Language Model Pretraining with Weak Supervision
and 215 more not named here
accuracy 116 other papers
66 dated earlier, 24 later, 26 same year, order not determinable · 8 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1610.05820 (2016-10)
Membership Inference Attacks Against Machine Learning Models
1905.03696 (2019-05)
HAWQ: Hessian AWare Quantization of Neural Networks with Mixed-Precision
and 113 more not named here
pil_loader 66 other papers
22 dated earlier, 24 later, 20 same year, order not determinable
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
and 63 more not named here
accuracy 13 other papers
6 dated earlier, 5 later, 2 same year, order not determinable
1706.02677 (2017-06)
Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour
1911.00068 (2019-11)
Confident Learning: Estimating Uncertainty in Dataset Labels
2011.09157 (2020-11)
Dense Contrastive Learning for Self-Supervised Visual Pre-Training
and 10 more not named here
mean_per_class 5 other papers
3 dated earlier, 1 later, 1 same year, order not determinable
2103.00020 (2021-03)
Learning Transferable Visual Models From Natural Language Supervision
2112.12750 (2021-12)
SLIP: Self-supervision meets Language-Image Pre-training
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
and 2 more not named here
get_model 4 other papers
1 dated earlier, 2 later, 1 same year, order not determinable
2212.04501 (2022-12)
Learning Video Representations from Large Language Models
2305.20088 (2023-05)
Improving CLIP Training with Language Rewrites
2402.01832 (2024-02)
SynthCLIP: Are We Ready for a Fully Synthetic CLIP Training?
and 1 more not named here
unwrap_model 4 other papers
2 later, 2 same year, order not determinable
2304.14636 (2023-04)
PreNAS: Preferred One-Shot Learning Towards Efficient Neural Architecture Search
2308.05734 (2023-08)
AudioLDM 2: Learning Holistic Audio Generation with Self-supervised Pretraining
2403.16831 (2024-03)
UrbanVLP: Multi-Granularity Vision-Language Pretraining for Urban Socioeconomic Indicator Prediction
and 1 more not named here
get_downstream_dataset 2 other papers
1 dated earlier, 1 same year, order not determinable
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
2304.09172 (2023-04)
Hyperbolic Image-Text Representations
train 2 other papers
1 dated earlier, 1 same year, order not determinable
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
2304.09172 (2023-04)
Hyperbolic Image-Text Representations
validate 2 other papers
1 dated earlier, 1 same year, order not determinable
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
2304.09172 (2023-04)
Hyperbolic Image-Text Representations
yfcc_loader 2 other papers
1 dated earlier, 1 same year, order not determinable
136860514 (2022 (year only))
SLIP: Self-supervision meets Language-Image Pre-training
2304.09172 (2023-04)
Hyperbolic Image-Text Representations
get_att_mask 1 other paper
1 later
2409.06809 (2024-09)
DetailCLIP: Detail-Oriented CLIP for Fine-Grained Tasks

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

Repositories linked to this paper

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

Abstract

In vision-language modeling, image token removal is an efficient augmentation technique to reduce the cost of encoding image features. The CLIP-style models, however, have been found to be negatively impacted by this technique. We hypothesize that removing a large portion of image tokens may inadvertently destroy the semantic information associated to a given text description, resulting in misaligned paired data in CLIP training. To address this issue, we propose an attentive token removal approach, which retains a small number of tokens that have a strong semantic correlation to the corresponding text description. The correlation scores are dynamically evaluated through an EMA-updated vision encoder. Our method, termed attentive mask CLIP, outperforms original CLIP and CLIP variant with random token removal while saving the training time. In addition, our approach also enables efficient multi-view contrastive learning. Experimentally, by training ViT-B on YFCC-15M dataset, our approach achieves 43.9% top-1 accuracy on ImageNet-1K zero-shot classification, 62.7/42.1 and 38.0/23.2 I2T/T2I retrieval accuracy on Flickr30K and MS COCO, outperforming SLIP by +1.1%, +5.5/+0.9, and +4.4/+1.3, respectively, while being 2.30× faster. An efficient version of our approach runs 1.16× faster than the plain CLIP model, while achieving significant gains of +5.3%, +11.3/+8.0, and +9.5/+4.9 on these benchmarks, respectively. Code will be release in https://github.com/microsoft/A-CLIP.

For agents

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

get_harvested_code_for_paper("Yang_Attentive_Mask_CLIP_ICCV_2023_paper")
get_code_for_paper("Yang_Attentive_Mask_CLIP_ICCV_2023_paper")
have("Yang_Attentive_Mask_CLIP_ICCV_2023_paper")

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

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

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

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

Connect an agent — have() is free.