SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.12246 · ICML · 2023

A Closer Look at Few-shot Classification Again

Jing Xu, Hao Wu, Xu Luo, Jingkuan Song, Lianli Gao, Ji Zhang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 16 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; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 5 failures of our instrument; 7 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/2301.12246.json · badge: /api/ran/2301.12246.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
Frankluox/Pytorch-MetaDataset canonical (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
frankluox/closerlookagainfewshot canonical (classifier label)
classifier basis: classifier_2025
1 ran · 4 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Frankluox/Pytorch-MetaDataset/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from njuvision/mpa, is pointer only (licence: NOASSERTION) · get_code("b47790190bfa0514")
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 njuvision/mpa, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

auto_resume_helper Ran
ran; our contract draft was wrong, not the code
Frankluox/Pytorch-MetaDataset/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from leaplabthu/inline, is pointer only (licence: NONE) · get_code("0c32459bef92ff8c")
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 leaplabthu/inline, 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.

build_optimizer Ran
ran on a synthesized input
Frankluox/Pytorch-MetaDataset/optimizer.py
code served (permissive licence) · get_code("42c6a0eb1009e616")
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 AdamW. 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 torch import optim

torch.manual_seed(0)

# Build a minimal model with parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Build a config object that has the required nested attributes
class Config:
    def __init__(self):
        self.TRAIN = TrainConfig()

class TrainConfig:
    def __init__(self):
        self.OPTIMIZER = OptimizerConfig()
        self.BASE_LR = 0.001
        self.WEIGHT_DECAY = 1e-5

class OptimizerConfig:
    def __init__(self):
        self.NAME = 'AdamW'
        self.MOMENTUM = 0.9
        self.EPS = 1e-8
        self.BETAS = (0.9, 0.999)

config = Config()

ARGS = {
    'config': config,
    'model': model,
}
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 AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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
build_scheduler Ran
ran on a synthesized input
Frankluox/Pytorch-MetaDataset/optimizer.py
code served (permissive licence) · get_code("febad46f3a8e0329")
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 CosineLRScheduler. 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.optim as optim
from yacs.config import CfgNode as CN

torch.manual_seed(0)

# Create a minimal model with parameters
class TinyModel(torch.nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = torch.nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = TinyModel()
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Build config object
config = CN()
config.TRAIN = CN()
config.TRAIN.SCHEDULE_PER_STEP = True
config.TRAIN.WARMUP_EPOCHS = 2
config.TRAIN.EPOCHS = 10
config.TRAIN.WARMUP_LR_INIT = 0.0
config.TRAIN.WARMUP_LR = 0.0001
config.TRAIN.LR_SCHEDULER = CN()
config.TRAIN.LR_SCHEDULER.NAME = 'cosine'
config.TRAIN.LR_SCHEDULER.DECAY_EPOCHS = 5
config.TRAIN.LR_SCHEDULER.DECAY_RATE = 0.1
config.TRAIN.LR_SCHEDULER.MULTISTEPS = [5, 8]
config.TRAIN.LR_SCHEDULER.GAMMA = 0.1
config.DATA = CN()
config.DATA.TRAIN = CN()
config.DATA.TRAIN.IS_EPISODIC = False
config.DATA.TRAIN.ITERATION_PER_EPOCH = 100
config.DATA.TRAIN.DATASET_NAMES = ['dataset1']
config.freeze()

n_iter_per_epoch = 50

ARGS = {
    'config': config,
    'optimizer': optimizer,
    'n_iter_per_epoch': n_iter_per_epoch
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch, yacs — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type CosineLRScheduler — a CosineLRScheduler output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CosineLRScheduler 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
create_logger Ran
ran; our contract draft was wrong, not the code
Frankluox/Pytorch-MetaDataset/logger.py
pointer only (licence: MIT); the stored copy get_code serves, from ghrua/seqpe, is pointer only (licence: NONE) · get_code("80450600f7f09b0a")
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 ghrua/seqpe, 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.

drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from gladzhang/Xformer
pointer only; the stored copy get_code serves, from gladzhang/Xformer, is pointer only (licence: NONE) · get_code("55120f2026b56aa2")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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_module Ran
ran on a synthesized input
Frankluox/Pytorch-MetaDataset/models/build.py
code served (permissive licence) · get_code("2685107849023379")
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 Linear. 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 unittest.mock import Mock, patch
import sys

torch.manual_seed(0)

# Create a minimal mock module structure
mock_model_module = Mock()

def mock_get_model(config):
    """Minimal model that accepts a config"""
    model = nn.Linear(4, 2)
    return model

mock_model_module.get_model = mock_get_model

# Mock the import_module to return our mock module
def mock_import_module(name, package=None):
    return mock_model_module

# Patch import_module at the module level where get_module will call it
sys.modules['modules.test_model'] = mock_model_module

# Create a minimal config dict
config = {
    'input_dim': 4,
    'output_dim': 2,
    'hidden_dim': 8,
}

ARGS = {
    'module_name': 'test_model',
    'config': config,
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
load_checkpoint Ran
ran on a synthesized input
Frankluox/Pytorch-MetaDataset/utils.py
code served (permissive licence) · get_code("dce200bb0559f13b")
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. 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
from unittest.mock import MagicMock
import logging

torch.manual_seed(0)

# Create a minimal config object
class Config:
    def __init__(self):
        self.MODEL = MagicMock()
        self.MODEL.RESUME = "checkpoint.pth"
        self.SAVE_TOP_K_MODEL = 3
        self.TRAIN = MagicMock()
        self.TRAIN.START_EPOCH = 0
        self._frozen = False
    
    def defrost(self):
        self._frozen = False
    
    def freeze(self):
        self._frozen = True

config = Config()

# Create a minimal model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Create optimizer
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)

# Create scheduler
lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.1)

# Create logger
logger = logging.getLogger('test_logger')
logger.setLevel(logging.INFO)
handler = logging.StreamHandler()
logger.addHandler(handler)

# Create a valid checkpoint dictionary
checkpoint = {
    'model': model.state_dict(),
    'optimizer': optimizer.state_dict(),
    'lr_scheduler': lr_scheduler.state_dict(),
    'epoch': 5,
    'max_accuracy': [0.85, 0.82, 0.80],
    'step': 1000
}

# Mock torch.load to return our checkpoint
import builtins
original_load = torch.load

def mock_load(path, map_location=None):
    return checkpoint

torch.load = mock_load

ARGS = {
    'config': config,
    'model': model,
    'optimizer': optimizer,
    'lr_scheduler': lr_scheduler,
    'logger': logger
}
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
trunc_normal_ Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
frankluox/closerlookagainfewshot/architectures/backbone/DINO_ViT.py
code served (permissive licence) · get_code("915b71e73a54fc97")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned Tensor, 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 torch
import math

torch.manual_seed(0)

# Create a small tensor to be modified by trunc_normal_
tensor = torch.empty(2, 4)

# Define parameters for truncated normal initialization
mean = 0.0
std = 1.0
a = -2.0
b = 2.0

ARGS = {
    'tensor': tensor,
    'mean': mean,
    'std': std,
    'a': a,
    'b': b
}
Setup block drafted by
a language model, Claude Sonnet 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 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
build_model Not yet run
unverified (harvested, no recorded run)
Frankluox/Pytorch-MetaDataset/models/build.py
code served (permissive licence) · get_code("b60ab7da028d1057")
How it ran

no invocation recorded.

get_config Not yet run
unverified (harvested, no recorded run)
Frankluox/Pytorch-MetaDataset/config.py
code served (permissive licence) · get_code("ae3e079034ff133b")
How it ran

no invocation recorded.

process_cifar Not yet run
unverified (harvested, no recorded run)
frankluox/closerlookagainfewshot/prepare_datasets.py
code served (permissive licence) · get_code("fcffd6777f074244")
How it ran

no invocation recorded.

process_mnist Not yet run
unverified (harvested, no recorded run)
frankluox/closerlookagainfewshot/prepare_datasets.py
code served (permissive licence) · get_code("33a2d0092101477f")
How it ran

no invocation recorded.

process_quickdraw Not yet run
unverified (harvested, no recorded run)
frankluox/closerlookagainfewshot/prepare_datasets.py
code served (permissive licence) · get_code("2dc8ad16af4aad88")
How it ran

no invocation recorded.

update_config Not yet run
unverified (harvested, no recorded run)
Frankluox/Pytorch-MetaDataset/config.py
code served (permissive licence) · get_code("ef39da1ccfb41dbb")
How it ran

no invocation recorded.

vit_tiny Not yet run
unverified (harvested, no recorded run)
frankluox/closerlookagainfewshot/architectures/backbone/DINO_ViT.py
code served (permissive licence) · get_code("0a55ce5c7c8fd9fd")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 8 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 2 the same month, 7 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
drop_path 224 other papers
66 dated earlier, 4 the same month, 147 later, 6 same year, order not determinable, 1 undated · 38 only as an assembly brick
2003.12039 (2020-03)
RAFT: Recurrent All-Pairs Field Transforms for Optical Flow
2007.09384 (2020-07)
Multi-Scale Positive Sample Refinement for Few-Shot Object Detection
2010.11929 (2020-10)
An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
and 221 more not named here
trunc_normal_ 160 other papers
46 dated earlier, 1 the same month, 111 later, 2 same year, order not determinable · 36 only as an assembly brick
1911.10194 (2019-11)
Panoptic-DeepLab: A Simple, Strong, and Fast Baseline for Bottom-Up Panoptic Segmentation
2005.10242 (2020-05)
Understanding Contrastive Representation Learning through Alignment and Uniformity on the Hypersphere
2007.12911 (2020-07)
Tighter risk certificates for neural networks
and 157 more not named here
get_config 51 other papers
15 dated earlier, 33 later, 3 same year, order not determinable
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.03746 (2021-06)
Efficient Training of Visual Transformers with Small Datasets
and 48 more not named here
create_logger 35 other papers
12 dated earlier, 21 later, 2 same year, order not determinable
2104.13840 (2021-04)
Twins: Revisiting the Design of Spatial Attention in Vision Transformers
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.03746 (2021-06)
Efficient Training of Visual Transformers with Small Datasets
and 32 more not named here
vit_tiny 33 other papers
8 dated earlier, 23 later, 1 same year, order not determinable, 1 undated
2201.02609 (2022-01)
Generalized Category Discovery
2202.11929 (2022-02)
Word Segmentation on Discovered Phone Units with Dynamic Programming and Self-Supervised Scoring
2203.08414 (2022-03)
Unsupervised Semantic Segmentation by Distilling Feature Correspondences
and 30 more not named here
auto_resume_helper 20 other papers
7 dated earlier, 13 later
2103.14030 (2021-03)
Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
2106.03650 (2021-06)
Shuffle Transformer: Rethinking Spatial Shuffle for Vision Transformer
2106.04263 (2021-06)
On the Connection between Local Attention and Dynamic Depth-wise Convolution
and 17 more not named here
accuracy 3 other papers
3 later
2312.06709 (2023-12)
AM-RADIO: Agglomerative Vision Foundation Model -- Reduce All Domains Into One
2404.03663 (2024-04)
Spike-driven Transformer V2: Meta Spiking Neural Network Architecture Inspiring the Design of Next-generation Neuromorphic Chips
2409.19660 (2024-09)
All-in-One Image Coding for Joint Human-Machine Vision with Multi-Path Aggregation
process_cifar 2 other papers
2 dated earlier
2003.03284 (2020-03)
TaskNorm: Rethinking Batch Normalization for Meta-Learning
2006.12245 (2020-06)
Enhancing Few-Shot Image Classification with Unlabelled Examples

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

Few-shot classification consists of a training phase where a model is learned on a relatively large dataset and an adaptation phase where the learned model is adapted to previously-unseen tasks with limited labeled samples. In this paper, we empirically prove that the training algorithm and the adaptation algorithm can be completely disentangled, which allows algorithm analysis and design to be done individually for each phase. Our meta-analysis for each phase reveals several interesting insights that may help better understand key aspects of few-shot classification and connections with other fields such as visual representation learning and transfer learning. We hope the insights and research challenges revealed in this paper can inspire future work in related directions. Code and pre-trained models (in PyTorch) are available at https://github.com/ Frankluox/CloserLookAgainFewShot.

For agents

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

get_harvested_code_for_paper("2301.12246")
get_code_for_paper("2301.12246")
have("2301.12246")

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

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

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

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

Connect an agent — have() is free.