SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.16788 · CVPR · 2021

DER: Dynamically Expandable Representation for Class Incremental Learning

Shipeng Yan, Xuming He, Jiangwei Xie

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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 2 have no contract verdict; 4 failures of our instrument; 5 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/2103.16788.json · badge: /api/ran/2103.16788.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
Rhyssiyan/DER-ClassIL.pytorch marked official in Papers with Code
Papers with Code archive
6 ran · 5 no recorded run
FunctionStatusWhere it lives
ClassErrorMeter Ran
ran on a synthesized input
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("9f4e9833f2b84b8d")
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 NoneType. 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 numpy as np

# INIT_ARGS: parameters for ClassErrorMeter.__init__
INIT_ARGS = {
    'topk': [1, 3],
    'accuracy': False
}

# ARGS: parameters for ClassErrorMeter.add (the main computation method)
# output: batch_size x num_classes (predictions/logits)
# target: batch_size (class indices)
ARGS = {
    'output': torch.randn(5, 10),  # 5 samples, 10 classes
    'target': torch.tensor([2, 0, 7, 3, 9])  # ground truth class indices
}

METHOD = 'add'
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GradualWarmupScheduler Ran
ran on a synthesized input
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("59a549e22e134aef")
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 NoneType. 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.optim import SGD
from torch.optim.lr_scheduler import StepLR

# Create a simple model and optimizer
model = nn.Linear(4, 3)
optimizer = SGD(model.parameters(), lr=0.1)

# Create an after_scheduler
after_scheduler = StepLR(optimizer, step_size=5, gamma=0.5)

INIT_ARGS = {
    'optimizer': optimizer,
    'multiplier': 2.0,
    'total_epoch': 10,
    'after_scheduler': after_scheduler
}

METHOD = 'step'

ARGS = {
    'epoch': None,
    'metrics': None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
extract_features Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("3df51f2e829fae0e")
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
import numpy as np

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        feat = self.linear(x)
        return {'feature': feat}

model = SimpleModel()

loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([1, 0])),
]

ARGS = {
    'model': model,
    'loader': loader,
}
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
random_selection Ran
ran; our contract draft was wrong, not the code
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("655d09e23b2af00d")
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.nn as nn
from unittest.mock import MagicMock

torch.manual_seed(0)

# Minimal network that does nothing (not actually used in the function)
class MinimalNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)

# Minimal logger
class MinimalLogger:
    def info(self, msg):
        pass

# Minimal dataset with required methods
class MinimalIncDataset:
    def __init__(self):
        self.memory_data = {
            0: (np.random.randn(5, 4).astype(np.float32), np.array([0, 0, 0, 0, 0], dtype=np.int64)),
            1: (np.random.randn(6, 4).astype(np.float32), np.array([1, 1, 1, 1, 1, 1], dtype=np.int64)),
            2: (np.random.randn(7, 4).astype(np.float32), np.array([2, 2, 2, 2, 2, 2, 2], dtype=np.int64)),
        }
        self.test_data = {
            2: (np.random.randn(8, 4).astype(np.float32), np.array([2, 2, 2, 2, 2, 2, 2, 2], dtype=np.int64)),
        }
    
    def get_custom_loader_from_memory(self, class_indices):
        class_idx = class_indices[0]
        inputs, targets = self.memory_data[class_idx]
        loader = None
        return inputs, targets, loader
    
    def get_custom_loader(self, class_idx, mode='test'):
        inputs, targets = self.test_data[class_idx]
        loader = None
        return inputs, targets, loader

n_classes = 3
task_size = 1
network = MinimalNetwork()
logger = MinimalLogger()
inc_dataset = MinimalIncDataset()
memory_per_class = [3, 4, 5]

ARGS = {
    'n_classes': n_classes,
    'task_size': task_size,
    'network': network,
    'logger': logger,
    'inc_dataset': inc_dataset,
    'memory_per_class': memory_per_class,
}
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
select_examplars Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("3fd7e4aeb10eb4da")
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

# Set seed for reproducibility
np.random.seed(0)

# Create a small feature matrix
# Shape: (num_samples, feature_dim)
# Using distinct dimensions: 5 samples, 3 features
features = np.random.randn(5, 3).astype(np.float32)

# Set nb_max to select a subset of exemplars
# Using a value less than the number of samples
nb_max = 3

ARGS = {
    "features": features,
    "nb_max": nb_max,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
update_classes_mean Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("c1c1a3649ab6dc82")
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 ndarray, ndim 2, dtype family float, shape (3, 4) as a later run recorded it. 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, 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 as nn
import numpy as np

torch.manual_seed(0)

# Build a minimal network that satisfies the function's usage
class MinimalNetwork(nn.Module):
    def __init__(self, features_dim=4):
        super().__init__()
        self.features_dim = features_dim
        self.linear = nn.Linear(3, features_dim)
    
    def forward(self, x):
        feat = self.linear(x)
        return {'feature': feat}

# Wrap network in a module wrapper to match network.module.features_dim access
class ModuleWrapper(nn.Module):
    def __init__(self, network):
        super().__init__()
        self.module = network
    
    def forward(self, x):
        return self.module(x)

# Build a stand-in dataset class with required methods
class StandInDataset:
    def __init__(self):
        self.data_inc = torch.randn(6, 3)  # 6 samples, 3 features
        self.targets_inc = torch.tensor([0, 0, 1, 1, 2, 2])  # 3 classes, 2 samples each
    
    def _get_loader(self, data, targets, shuffle=False, share_memory=None, mode='test'):
        # Return a simple list of batches
        batch_size = 2
        loader = []
        for i in range(0, len(data), batch_size):
            x_batch = data[i:i+batch_size]
            y_batch = targets[i:i+batch_size]
            loader.append((x_batch, y_batch))
        return loader

# Create instances
network = ModuleWrapper(MinimalNetwork(features_dim=4))
inc_dataset = StandInDataset()
n_classes = 3
task_size = 2

ARGS = {
    'network': network,
    'inc_dataset': inc_dataset,
    'n_classes': n_classes,
    'task_size': task_size,
    'share_memory': None,
    'metric': 'cosine',
    'EPSILON': 1e-08
}
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 ndarray, ndim 2, dtype family float, shape (3, 4) — shape (3, 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
IncModel Not yet run
unverified (harvested, no recorded run)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("555fea3dd6290bee")
How it ran

no invocation recorded.

IncrementalLearner Not yet run
unverified (harvested, no recorded run)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("14b065dca3ad5ccd")
How it ran

no invocation recorded.

MemorySize Not yet run
unverified (harvested, no recorded run)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("6fa0e1315b22f977")
How it ran

no invocation recorded.

finetune_last_layer Not yet run
unverified (harvested, no recorded run)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("d9536cea4ed511c1")
How it ran

no invocation recorded.

herding Not yet run
unverified (harvested, no recorded run)
Rhyssiyan/DER-ClassIL.pytorch/inclearn/models/incmodel.py
code served (permissive licence) · get_code("60a5b69027a3fe6f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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-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

We address the problem of class incremental learning, which is a core step towards achieving adaptive vision intelligence. In particular, we consider the task setting of incremental learning with limited memory and aim to achieve better stability-plasticity trade-off. To this end, we propose a novel two-stage learning approach that utilizes a dynamically expandable representation for more effective incremental concept modeling. Specifically, at each incremental step, we freeze the previously learned representation and augment it with additional feature dimensions from a new learnable feature extractor. This enables us to integrate new visual concepts with retaining learned knowledge. We dynamically expand the representation according to the complexity of novel concepts by introducing a channel-level mask-based pruning strategy. Moreover, we introduce an auxiliary loss to encourage the model to learn diverse and discriminate features for novel concepts. We conduct extensive experiments on the three class incremental learning benchmarks and our method consistently outperforms other methods with a large margin. 1 * Both authors contributed equally.

For agents

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

get_harvested_code_for_paper("2103.16788")
get_code_for_paper("2103.16788")
have("2103.16788")

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

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

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

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

Connect an agent — have() is free.