SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.04898 · 2023

Two Complementary Perspectives to Continual Learning: Ask Not Only What to Optimize, But Also How

arXiv · PDF · Open in the Atlas

Code that ran

9 of 9 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 0 have no contract verdict; 9 failures of our instrument; 0 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/2311.04898.json · badge: /api/ran/2311.04898.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
timmhess/twocomplementaryperspectivescl canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
AE_loss Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/models/expert_gate.py
code served (permissive licence) · get_code("16b9e00f007a0abf")
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 as nn
from torch.nn.functional import mse_loss

torch.manual_seed(0)

# Create small tensors for target and reconstruction
# Using distinct dimensions: batch_size=2, feature_dim=4
target = torch.randn(2, 4)
reconstruction = torch.randn(2, 4)

ARGS = {
    "target": target,
    "reconstruction": reconstruction,
}
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
check_overwrite_directory Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/helper.py
code served (permissive licence) · get_code("baa60c6b90daab7c")
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, ndim 1, 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 os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_base = tempfile.mkdtemp()
penultimate = os.path.join(temp_base, 'experiments')
os.makedirs(penultimate, exist_ok=True)

# Create a matching directory with the target name
target_dir = os.path.join(penultimate, 'my_experiment_run')
os.makedirs(target_dir, exist_ok=True)

# Construct a test string path that includes the directory structure
test_string = os.path.join(penultimate, 'my_experiment_run_v1')

ARGS = {
    's': test_string
}
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 tuple, ndim 1, dtype family float — a tuple 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
compare_keys Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/models/dynamic_optimizers.py
code served (permissive licence) · get_code("4468c94aca4d060f")
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, 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)

# The function compares keys between two dictionaries
# It uses .keys() method on both dicts and performs set operations
# No actual values are accessed, only keys matter

old_dict = {
    "key1": torch.randn(2, 4),
    "key2": "value2",
    "key3": 42,
    "shared_key": [1, 2, 3]
}

new_dict = {
    "shared_key": torch.randn(3, 5),
    "key4": "new_value",
    "key5": {"nested": "dict"},
    "key1": None
}

ARGS = {
    "old_dict": old_dict,
    "new_dict": new_dict
}
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, ndim 2, dtype family float — a tuple 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
cut_string Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/helper.py
code served (permissive licence) · get_code("1c48b422727921a2")
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 str. 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

def cut_string(s):
    index = s.find('_e=')
    if index != -1:
        s = s[:index]
    return s

ARGS = {
    's': 'hello_world_e=123_suffix'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
deprecated Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/_annotations.py
code served (permissive licence) · get_code("667a50347702db96")
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 function. 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 warnings
import functools
import inspect


def deprecated(version: float, reason: str):
    """Decorator to mark functions as deprecated.

    Emits a warning when the function is used.

    :param version: when it will be removed
    :param reason: motivation for deprecation, possibly with suggested
        alternative
    :return:
    """

    def decorator(func):
        if inspect.isclass(func):
            msg_prefix = 'Call to deprecated class {name}'
        else:
            msg_prefix = 'Call to deprecated function {name}'
        msg_suffix = ' (removal in version {version}: {reason})'
        msg = msg_prefix + msg_suffix
        if func.__doc__ is None:
            func.__doc__ = ''
        else:
            func.__doc__ += '\n\n'
        func.__doc__ += 'Warning: Deprecated' + msg_suffix.format(name=func.__name__, version=version, reason=reason)

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            warnings.simplefilter('always', DeprecationWarning)
            warnings.warn(msg.format(name=func.__name__, version=version, reason=reason), category=DeprecationWarning, stacklevel=2)
            warnings.simplefilter('default', DeprecationWarning)
            return func(*args, **kwargs)
        return wrapper
    return decorator


# Test function to decorate
def sample_function():
    """This is a sample function."""
    return "result"


# Setup arguments for the deprecated decorator
ARGS = {
    'version': 2.0,
    'reason': 'Use new_function() instead for better performance'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
experimental Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/_annotations.py
code served (permissive licence) · get_code("9bd77285b9ea9767")
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 function. 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 functools
from typing import Optional

def experimental(reason: Optional[str]=None):
    """Decorator for experimental API.

    Experimental APIs are newer functionality.
    They are well tested, but due to their novelty there may be minor bugs
    or their intergace may still change in the next releases.

    It can be used to decorate methods.

    .. code-block:: python
        from avalanche._annotations import ExperimentalAPI
        @DeveloperAPI
        def shining_new_method():
            print("Hello, world!")

    :param reason: a message to append to the documentation explaining
        the motivation for the experimental tag.
    :return:
    """
    if reason is None:
        reason = ''

    def decorator(func):
        if func.__doc__ is None:
            func.__doc__ = ''
        else:
            func.__doc__ += '\n\n'
        func.__doc__ += 'Warning: Experimental API. ' + reason

        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            return func(*args, **kwargs)
        return wrapper
    return decorator


# Setup code to construct valid arguments for the experimental function

ARGS = {
    'reason': 'This API is still under active development and may change in future releases.'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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_transforms Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
timmhess/twocomplementaryperspectivescl/helper.py
code served (permissive licence) · get_code("c3dd6c1f097353b6")
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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from torchvision import transforms

torch.manual_seed(0)

ARGS = {
    'data_aug': 'crop_flip',
    'input_size': (32, 64, 64),
    'norm_mean': (0.485, 0.456, 0.406),
    'norm_std': (0.229, 0.224, 0.225),
    'use_to_pil': False,
    'use_corruption': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
reset_optimizer Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/models/dynamic_optimizers.py
code served (permissive licence) · get_code("551c67f1ad0c8a2c")
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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a simple model with named 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()

# Create an optimizer with a single parameter group
optimizer = SGD(model.parameters(), lr=0.01)

ARGS = {
    "optimizer": optimizer,
    "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 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
update_optimizer Ran
ran; our contract draft was wrong, not the code
timmhess/twocomplementaryperspectivescl/avalanche/models/dynamic_optimizers.py
code served (permissive licence) · get_code("d0dc299a23419623")
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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create simple parameters
param1 = nn.Parameter(torch.randn(4))
param2 = nn.Parameter(torch.randn(3))
param3 = nn.Parameter(torch.randn(5))

# Create optimizer with initial parameters
optimizer = SGD([param1, param2], lr=0.01)

# Create the dicts for old and new parameters
old_params = {
    'param1': param1,
    'param2': param2,
}

new_params = {
    'param1': param1,
    'param2': param2,
    'param3': param3,  # new parameter
}

optimized_params = {
    'param1': param1,
    'param2': param2,
}

ARGS = {
    'optimizer': optimizer,
    'new_params': new_params,
    'optimized_params': optimized_params,
    'reset_state': False,
}
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

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 later) and 4 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
AE_loss 1 other paper
1 dated earlier
2104.00405 (2021-04)
Avalanche: an End-to-End Library for Continual Learning
compare_keys 1 other paper
1 dated earlier
2104.00405 (2021-04)
Avalanche: an End-to-End Library for Continual Learning
deprecated 1 other paper
1 dated earlier
2104.00405 (2021-04)
Avalanche: an End-to-End Library for Continual Learning
experimental 1 other paper
1 dated earlier
2104.00405 (2021-04)
Avalanche: an End-to-End Library for Continual Learning
update_optimizer 1 other paper
1 dated earlier
2104.00405 (2021-04)
Avalanche: an End-to-End Library for Continual Learning

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

Recent years have seen considerable progress in the continual training of deep neural networks, predominantly thanks to approaches that add replay or regularization terms to the loss function to approximate the joint loss over all tasks so far. However, we show that even with a perfect approximation to the joint loss, these approaches still suffer from temporary but substantial forgetting when starting to train on a new task. Motivated by this 'stability gap', we propose that continual learning strategies should focus not only on the optimization objective, but also on the way this objective is optimized. While there is some continual learning work that alters the optimization trajectory (e.g., using gradient projection techniques), this line of research is positioned as alternative to improving the optimization objective, while we argue it should be complementary. In search of empirical support for our proposition, we perform a series of pre-registered experiments combining replay-approximated joint objectives with gradient projection-based optimization routines. However, this first experimental attempt fails to show clear and consistent benefits. Nevertheless, our conceptual arguments, as well as some of our empirical results, demonstrate the distinctive importance of the optimization trajectory in continual learning, thereby opening up a new direction for continual learning research.

For agents

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

get_harvested_code_for_paper("2311.04898")
get_code_for_paper("2311.04898")
have("2311.04898")

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

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

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

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

Connect an agent — have() is free.