SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.17022 · 2024

Compositional Few-Shot Class-Incremental Learning

arXiv · PDF · Open in the Atlas

Code that ran

9 of 15 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 0 have no contract verdict; 8 failures of our instrument; 6 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/2405.17022.json · badge: /api/ran/2405.17022.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
zoilsen/comp-fscil canonical (classifier label)
classifier basis: census
9 ran · 6 no recorded run
FunctionStatusWhere it lives
conv1x1 Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet18_encoder.py
code served (permissive licence) · get_code("d9def42110729a85")
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 Conv2d. 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 conv1x1 takes in_planes, out_planes, and stride as parameters
# It returns an nn.Conv2d layer configured for 1x1 convolution
# We need to provide valid integer arguments for these parameters

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv1x1 Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet12.py
code served (permissive licence) · get_code("de92832114f71d8c")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet18_encoder.py
code served (permissive licence) · get_code("160bb14bd76201b4")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
    "stride": 1,
    "groups": 1,
    "dilation": 1,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
conv3x3 Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet20_cifar.py
pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db")
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 lixiaotong97/DSU, 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.

conv3x3 Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet12.py
code served (permissive licence) · get_code("e5b7c79b0b62af96")
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 Conv2d. 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)

ARGS = {
    "in_planes": 3,
    "out_planes": 64,
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
get_base_dataloader Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/dataloader/data_utils.py
code served (permissive licence) · get_code("3f0e2ea167ccd1bf")
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 numpy as np
import torch
import torch.utils.data as data

torch.manual_seed(0)

# Stand-in dataset classes
class StandInDataset(data.Dataset):
    def __init__(self, root, train, index, base_sess=False, download=False):
        self.root = root
        self.train = train
        self.index = index
        self.base_sess = base_sess
        self.data = [torch.randn(3, 32, 32) for _ in range(10)]
        self.targets = [i % len(index) for i in range(10)]
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

class StandInCIFAR100(StandInDataset):
    pass

class StandInCUB200(StandInDataset):
    pass

class StandInMiniImageNet(StandInDataset):
    pass

class StandInTierImageNet(StandInDataset):
    pass

class StandInMiniBaseTierNovel(StandInDataset):
    pass

class StandInImageNet(StandInDataset):
    pass

# Stand-in Dataset module
class DatasetModule:
    CIFAR100 = StandInCIFAR100
    CUB200 = StandInCUB200
    MiniImageNet = StandInMiniImageNet
    TierImageNet = StandInTierImageNet
    miniBase_tierNovel = StandInMiniBaseTierNovel
    ImageNet = StandInImageNet

# Stand-in args object
class Args:
    def __init__(self):
        self.dataset = 'cifar100'
        self.base_class = 60
        self.dataroot = '/tmp/data'
        self.batch_size_base = 2
        self.test_batch_size = 2
        self.num_workers = 0
        self.Dataset = DatasetModule()

ARGS = {
    'args': Args()
}
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 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
load_state_dict_from_url Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet18_encoder.py
code served (permissive licence) · get_code("422a6083ee9c106d")
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. 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 os
import tempfile
import shutil

torch.manual_seed(0)

# Create a temporary directory for model caching
temp_model_dir = tempfile.mkdtemp()

# Create a minimal valid state dict file locally to simulate a cached model
dummy_state_dict = {
    'layer1.weight': torch.randn(4, 3),
    'layer1.bias': torch.randn(4),
}

# Save the dummy state dict to a file with proper naming convention
# Format: filename-<hash>.pth where hash is SHA256
import hashlib
state_dict_bytes = torch.jit.trace(torch.nn.Identity(), torch.randn(1)).state_dict()
dummy_path = os.path.join(temp_model_dir, 'dummy_model-5c106cde.pth')
torch.save(dummy_state_dict, dummy_path)

# Construct arguments for load_state_dict_from_url
# Since we can't do actual network downloads, we'll pass a fake URL
# The function will look for the file based on the URL's basename
ARGS = {
    'url': 'https://example.com/dummy_model-5c106cde.pth',
    'model_dir': temp_model_dir,
    'map_location': None,
    'progress': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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
norm_layer Ran
ran; our contract draft was wrong, not the code
zoilsen/comp-fscil/models/resnet12.py
code served (permissive licence) · get_code("f36ac42575cd46ee")
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 BatchNorm2d. 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)

ARGS = {
    "planes": 64
}
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 BatchNorm2d — a BatchNorm2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BatchNorm2d 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
set_gpu Ran
ran, honoured the contract we drafted
zoilsen/comp-fscil/utils.py
code served (permissive licence) · get_code("8327880f0b76f9db")
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 int, ndim 0, dtype family int, 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 os

class Args:
    def __init__(self, gpu):
        self.gpu = gpu

ARGS = {
    'args': Args(gpu='0,1')
}
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 int, ndim 0, dtype family int, 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
base_train Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/models/base/helper.py
code served (permissive licence) · get_code("ddaa52a660b55402")
How it ran

no invocation recorded.

count_acc Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/utils.py
code served (permissive licence) · get_code("684d8ecbca8220ab")
How it ran

no invocation recorded.

get_dataloader Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/dataloader/data_utils.py
code served (permissive licence) · get_code("91defe5d31d82cad")
How it ran

no invocation recorded.

replace_base_fc Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/models/base/helper.py
code served (permissive licence) · get_code("fa6d7dbb6906a211")
How it ran

no invocation recorded.

set_up_datasets Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/dataloader/data_utils.py
code served (permissive licence) · get_code("dc5f16fd17d2ba25")
How it ran

no invocation recorded.

test Not yet run
unverified (harvested, no recorded run)
zoilsen/comp-fscil/models/base/helper.py
code served (permissive licence) · get_code("7e0029dd3479294e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 3 the same month, 3 later) and 5 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
conv3x3 686 other papers
588 dated earlier, 7 the same month, 74 later, 17 same year, order not determinable · 31 only as an assembly brick
1406.2661 (2014-06)
Generative Adversarial Networks
1409.0575 (2014-09)
ImageNet Large Scale Visual Recognition Challenge
1412.6572 (2014-12)
Explaining and Harnessing Adversarial Examples
and 683 more not named here
conv1x1 431 other papers
351 dated earlier, 12 the same month, 57 later, 10 same year, order not determinable, 1 undated · 38 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1506.01186 (2015-06)
Cyclical Learning Rates for Training Neural Networks
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
and 428 more not named here
conv3x3 312 other papers
246 dated earlier, 10 the same month, 45 later, 10 same year, order not determinable, 1 undated · 31 only as an assembly brick
1409.1556 (2014-09)
Very Deep Convolutional Networks for Large-Scale Image Recognition
1507.05717 (2015-07)
An End-to-End Trainable Neural Network for Image-based Sequence Recognition and Its Application to Scene Text Recognition
1512.03385 (2015-12)
Deep Residual Learning for Image Recognition
and 309 more not named here
conv1x1 5 other papers
4 dated earlier, 1 same year, order not determinable
2003.04390 (2020-03)
Meta-Baseline: Exploring Simple Meta-Learning for Few-Shot Learning
2009.04960 (2020-09)
Prototype Completion with Primitive Knowledge for Few-Shot Learning
2010.00763 (2020-10)
BONGARD-LOGO: A New Benchmark for Human-Level Concept Learning and Reasoning
and 2 more not named here
conv3x3 5 other papers
4 dated earlier, 1 same year, order not determinable
2003.04390 (2020-03)
Meta-Baseline: Exploring Simple Meta-Learning for Few-Shot Learning
2009.04960 (2020-09)
Prototype Completion with Primitive Knowledge for Few-Shot Learning
2010.00763 (2020-10)
BONGARD-LOGO: A New Benchmark for Human-Level Concept Learning and Reasoning
and 2 more not named here
count_acc 4 other papers
4 dated earlier
1906.02944 (2019-06)
Learning Adaptive Classifiers Synthesis for Generalized Few-Shot Learning
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning
2104.03047 (2021-04)
Few-Shot Incremental Learning with Continually Evolved Classifiers
and 1 more not named here
load_state_dict_from_url 4 other papers
4 dated earlier
2104.03047 (2021-04)
Few-Shot Incremental Learning with Continually Evolved Classifiers
2208.00147 (2022-08)
Few-Shot Class-Incremental Learning from an Open-Set Perspective
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
and 1 more not named here
norm_layer 4 other papers
3 dated earlier, 1 same year, order not determinable
2003.04390 (2020-03)
Meta-Baseline: Exploring Simple Meta-Learning for Few-Shot Learning
2009.04960 (2020-09)
Prototype Completion with Primitive Knowledge for Few-Shot Learning
2010.00763 (2020-10)
BONGARD-LOGO: A New Benchmark for Human-Level Concept Learning and Reasoning
and 1 more not named here
set_gpu 4 other papers
4 dated earlier
2003.06777 (2020-03)
DeepEMD: Differentiable Earth Mover's Distance for Few-Shot Learning
2104.03047 (2021-04)
Few-Shot Incremental Learning with Continually Evolved Classifiers
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation
and 1 more not named here
get_dataloader 2 other papers
2 dated earlier
2104.03047 (2021-04)
Few-Shot Incremental Learning with Continually Evolved Classifiers
2210.04524 (2022-10)
Margin-Based Few-Shot Class-Incremental Learning with Class-Level Overfitting Mitigation

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 class-incremental learning (FSCIL) is proposed to continually learn from novel classes with only a few samples after the (pre-)training on base classes with sufficient data. However, this remains a challenge. In contrast, humans can easily recognize novel classes with a few samples. Cognitive science demonstrates that an important component of such human capability is compositional learning. This involves identifying visual primitives from learned knowledge and then composing new concepts using these transferred primitives, making incremental learning both effective and interpretable. To imitate human compositional learning, we propose a cognitive-inspired method for the FSCIL task. We define and build a compositional model based on set similarities, and then equip it with a primitive composition module and a primitive reuse module. In the primitive composition module, we propose to utilize the Centered Kernel Alignment (CKA) similarity to approximate the similarity between primitive sets, allowing the training and evaluation based on primitive compositions. In the primitive reuse module, we enhance primitive reusability by classifying inputs based on primitives replaced with the closest primitives from other classes. Experiments on three datasets validate our method, showing it outperforms current state-of-the-art methods with improved interpretability. Our code is available at https://github.com/Zoilsen/Comp-FSCIL.

For agents

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

get_harvested_code_for_paper("2405.17022")
get_code_for_paper("2405.17022")
have("2405.17022")

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

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

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

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

Connect an agent — have() is free.