SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.00070 · 2020

Conditional Channel Gated Networks for Task-Aware Continual Learning

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 5 have no contract verdict; 0 failures of our instrument; 1 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/2004.00070.json · badge: /api/ran/2004.00070.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
lit-leo/cgate community (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
FunctionStatusWhere it lives
convert_to_layerwise_stat Ran
ran on a synthesized input
lit-leo/cgate/src/visualization.py
code served (permissive licence) · get_code("7b63a04724226238")
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 list. 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 expects taskwise_stat to be a list of lists of tensors
# Each outer list element represents a task
# Each inner list represents layers within that task
# Each element is a tensor of firing frequencies

# Create a small example:
# 3 tasks, 2 layers per task
# Layer 1: shape (4,) for each task
# Layer 2: shape (3,) for each task

taskwise_stat = [
    [
        torch.randn(4),  # Task 0, Layer 0
        torch.randn(3),  # Task 0, Layer 1
    ],
    [
        torch.randn(4),  # Task 1, Layer 0
        torch.randn(3),  # Task 1, Layer 1
    ],
    [
        torch.randn(4),  # Task 2, Layer 0
        torch.randn(3),  # Task 2, Layer 1
    ],
]

ARGS = {
    "taskwise_stat": taskwise_stat
}
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 list — a list 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
extract_taskwise_stat Ran
ran on a synthesized input
lit-leo/cgate/src/visualization.py
code served (permissive licence) · get_code("fc08404570af13c6")
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 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 os
import pickle
import tempfile

# Create a temporary directory to serve as rootdir
tmpdir = tempfile.mkdtemp()

# Create sample pickle files with the expected data structure
# The function expects pickle files containing 'gates_freq' which is an iterable of tuples
# Each tuple is (freq, n_agg) where freq and n_agg are indexable by task_idx

# Create 3 pickle files (task 0, 1, 2)
for task_file_idx in range(3):
    # gates_freq is a list of tuples where each tuple is (freq_list, n_agg_list)
    # freq[task_idx] and n_agg[task_idx] are accessed, so they must be indexable
    gates_freq_data = [
        (
            [10.0, 20.0, 15.0],  # freq list - indexed by task_idx
            [100, 100, 100]       # n_agg list - indexed by task_idx
        ),
        (
            [5.0, 12.0, 8.0],
            [50, 50, 50]
        ),
        (
            [25.0, 30.0, 22.0],
            [200, 200, 200]
        ),
    ]
    
    data = {
        'gates_freq': gates_freq_data
    }
    
    fname = os.path.join(tmpdir, f'task_{task_file_idx:02d}.pickle')
    with open(fname, 'wb') as f:
        pickle.dump(data, f)

ARGS = {
    'rootdir': tmpdir
}
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 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
get_coreset_loader Ran
ran on a synthesized input
lit-leo/cgate/src/data.py
code served (permissive licence) · get_code("f3ca9493477db598")
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 DataLoader. 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.utils.data import Dataset

torch.manual_seed(0)

class SimpleDataset(Dataset):
    def __init__(self, size=10, input_dim=4):
        self.size = size
        self.input_dim = input_dim
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        x = torch.randn(self.input_dim)
        y = torch.randint(0, 2, (1,)).item()
        return x, y

class TaskedDataset(Dataset):
    def __init__(self, size=10, input_dim=4):
        self.dataset = SimpleDataset(size=size, input_dim=input_dim)
    
    def __len__(self):
        return len(self.dataset)
    
    def __getitem__(self, idx):
        return self.dataset[idx]
    
    def get_random_coreset(self, size=100):
        # Return a coreset dataset if size is less than total, else return None
        if size >= len(self.dataset):
            return None
        
        # Create a smaller dataset for the coreset
        indices = torch.randperm(len(self.dataset))[:size]
        coreset = torch.utils.data.Subset(self.dataset, indices.tolist())
        return coreset

train_dataset = TaskedDataset(size=200, input_dim=4)

ARGS = {
    "train_dataset": train_dataset,
    "coreset_size": 100,
}
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 DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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_loaders Ran
ran on a synthesized input
lit-leo/cgate/src/data.py
code served (permissive licence) · get_code("de186ee17852ec67")
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
from torch.utils.data import Dataset

torch.manual_seed(0)

class DummyDataset(Dataset):
    def __init__(self, num_samples=8, input_dim=4, output_dim=3):
        self.num_samples = num_samples
        self.input_dim = input_dim
        self.output_dim = output_dim
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        x = torch.randn(self.input_dim)
        y = torch.randint(0, self.output_dim, (1,)).item()
        return x, y

train_dataset = DummyDataset(num_samples=8, input_dim=4, output_dim=3)
val_dataset = DummyDataset(num_samples=4, input_dim=4, output_dim=3)
test_dataset = DummyDataset(num_samples=4, input_dim=4, output_dim=3)
batch_size = 2

ARGS = {
    "train_dataset": train_dataset,
    "val_dataset": val_dataset,
    "test_dataset": test_dataset,
    "batch_size": batch_size
}
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 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
gumbel_sigmoid Ran
ran on a synthesized input
lit-leo/cgate/src/blocks.py
code served (permissive licence) · get_code("e0f0ddbe7f79c547")
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 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

torch.manual_seed(0)

# logits: a tensor of log-odds values
# tau: temperature parameter (float)

logits = torch.randn(2, 4)
tau = 0.5

ARGS = {
    "logits": logits,
    "tau": tau,
}
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 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
prepare_dataset Not yet run
unverified (harvested, no recorded run)
lit-leo/cgate/src/data.py
code served (permissive licence) · get_code("9dce6d4bf3b88343")
How it ran

no invocation recorded.

Also present in other papers' code

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

Convolutional Neural Networks experience catastrophic forgetting when optimized on a sequence of learning problems: as they meet the objective of the current training examples, their performance on previous tasks drops drastically. In this work, we introduce a novel framework to tackle this problem with conditional computation. We equip each convolutional layer with task-specific gating modules, selecting which filters to apply on the given input. This way, we achieve two appealing properties. Firstly, the execution patterns of the gates allow to identify and protect important filters, ensuring no loss in the performance of the model for previously learned tasks. Secondly, by using a sparsity objective, we can promote the selection of a limited set of kernels, allowing to retain sufficient model capacity to digest new tasks.Existing solutions require, at test time, awareness of the task to which each example belongs to. This knowledge, however, may not be available in many practical scenarios. Therefore, we additionally introduce a task classifier that predicts the task label of each example, to deal with settings in which a task oracle is not available. We validate our proposal on four continual learning datasets. Results show that our model consistently outperforms existing methods both in the presence and the absence of a task oracle. Notably, on Split SVHN and Imagenet-50 datasets, our model yields up to 23.98% and 17.42% improvement in accuracy w.r.t. competing methods.

For agents

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

get_harvested_code_for_paper("2004.00070")
get_code_for_paper("2004.00070")
have("2004.00070")

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

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

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

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

Connect an agent — have() is free.