SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.05152 · CVPR · 2021

Knowledge Evolution in Neural Networks

Larry Davis, Abhinav Shrivastava, Ahmed Taha

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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 1 has no contract verdict; 7 failures of our instrument; 2 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.05152.json · badge: /api/ran/2103.05152.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
ahmdtaha/knowledge_evolution marked official in Papers with Code
Papers with Code archive
8 ran · 2 no recorded run
FunctionStatusWhere it lives
ProgressMeter Ran
ran on a synthesized input
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("141518eec41c8dd6")
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
from torch.utils.tensorboard import SummaryWriter
import tempfile
import os

# Mock meter class to use in ProgressMeter
class MockMeter:
    def __init__(self, name, write_val=True, write_avg=True):
        self.name = name
        self.val = 0.5
        self.avg = 0.45
        self.write_val = write_val
        self.write_avg = write_avg
    
    def __str__(self):
        return f"{self.name}: {self.val:.4f} (avg: {self.avg:.4f})"

# Mock config with logger
class MockConfig:
    def __init__(self):
        self.logger = self
    
    def info(self, msg):
        print(msg)

# Import the class
from torch.utils.tensorboard import SummaryWriter
import tqdm

class ProgressMeter(object):

    def __init__(self, num_batches, meters, cfg, prefix=''):
        self.batch_fmtstr = self._get_batch_fmtstr(num_batches)
        self.meters = meters
        self.prefix = prefix
        self.cfg = cfg

    def display(self, batch, tqdm_writer=False):
        entries = [self.prefix + self.batch_fmtstr.format(batch)]
        entries += [str(meter) for meter in self.meters]
        if not tqdm_writer:
            self.cfg.logger.info('\t'.join(entries))
        else:
            tqdm.tqdm.write('\t'.join(entries))

    def write_to_tensorboard(self, writer: SummaryWriter, prefix='train', global_step=None):
        for meter in self.meters:
            avg = meter.avg
            val = meter.val
            if meter.write_val:
                writer.add_scalar(f'{prefix}/{meter.name}_val', val, global_step=global_step)
            if meter.write_avg:
                writer.add_scalar(f'{prefix}/{meter.name}_avg', avg, global_step=global_step)

    def _get_batch_fmtstr(self, num_batches):
        num_digits = len(str(num_batches // 1))
        fmt = '{:' + str(num_digits) + 'd}'
        return '[' + fmt + '/' + fmt.format(num_batches) + ']'


INIT_ARGS = {
    'num_batches': 100,
    'meters': [
        MockMeter('loss', write_val=True, write_avg=True),
        MockMeter('accuracy', write_val=True, write_avg=True),
    ],
    'cfg': MockConfig(),
    'prefix': 'Epoch [1] ',
}

ARGS = {
    'batch': 5,
    'tqdm_writer': False,
}

METHOD = 'display'

if __name__ == '__main__':
    progress_meter = ProgressMeter(**INIT_ARGS)
    progress_meter.display(**ARGS)
    
    # Also test write_to_tensorboard
    with tempfile.TemporaryDirectory() as tmpdir:
        writer = SummaryWriter(tmpdir)
        progress_meter.write_to_tensorboard(writer, prefix='train', global_step=1)
        writer.close()
    
    print("ProgressMeter test completed successfully")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, tqdm — 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)
constant_lr Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("02513766727c1955")
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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Create a minimal args object with required attributes
class Args:
    def __init__(self):
        self.lr = 0.1
        self.warmup_length = 5

args = Args()

ARGS = {
    'optimizer': optimizer,
    'args': args
}
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
cosine_lr Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("e00ffa6d0e1a9ddb")
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 torch.nn as nn
import torch.optim as optim
import numpy as np

torch.manual_seed(0)

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

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

# Create args object with required attributes
class Args:
    def __init__(self):
        self.lr = 0.1
        self.warmup_length = 5
        self.epochs = 20

args = Args()

ARGS = {
    'optimizer': optimizer,
    '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 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_optimizer Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("d8fd6e0b4bb8c99d")
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 SGD. 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 MagicMock

torch.manual_seed(0)

# Create a simple logger mock
class Logger:
    def info(self, msg):
        pass

# Create a simple embedding module
class EmbeddingModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(10, 4)
    
    def forward(self, x):
        return self.embedding(x)

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

# Create args object
class Args:
    def __init__(self):
        self.logger = Logger()
        self.gpu = -1  # CPU mode
        self.lr = 0.01
        self.momentum = 0.9
        self.weight_decay = 1e-4
        self.optimizer = 'sgd'
        self.ml_loss = None

# Create criterion mock for Proxy_Anchor case
class CriterionMock:
    def __init__(self):
        self.proxies = nn.Parameter(torch.randn(5, 4))

# Construct ARGS dict
model = SimpleModel()
args = Args()
criterion = CriterionMock()

ARGS = {
    'args': args,
    'model': model,
    'fine_tune': False,
    'criterion': None
}
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 SGD — a SGD output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SGD 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_policy Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("680e25d1c3bf5523")
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 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 torch.nn as nn
import torch.optim as optim
import numpy as np

torch.manual_seed(0)

# 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)

# Create optimizer
model = SimpleModel()
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Create args object with all required attributes
class Args:
    def __init__(self):
        self.lr = 0.1
        self.warmup_length = 5
        self.epochs = 100
        self.lr_gamma = 0.1
        self.lr_adjust = 30

args = Args()

# Create cfg object for step_lr (uses cfg instead of args)
class Config:
    def __init__(self):
        self.lr = 0.1
        self.epochs = 100

cfg = Config()

ARGS = {
    'name': 'constant_lr'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
get_trainer Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("2e692a0113e3d709")
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 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 logging
from unittest.mock import MagicMock
import sys
from pathlib import Path

torch.manual_seed(0)

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

# Create a mock args object
class Args:
    def __init__(self):
        self.logger = logger
        self.trainer = 'dummy'

# Create mock trainer modules to be importable
class MockTrainer:
    @staticmethod
    def train():
        return "train_result"
    
    @staticmethod
    def validate():
        return "validate_result"

# Mock the trainers module structure
mock_trainers_module = MagicMock()
mock_trainers_module.dummy = MockTrainer()

# Inject into sys.modules so importlib can find it
sys.modules['trainers'] = MagicMock()
sys.modules['trainers.dummy'] = MockTrainer()

args = Args()

ARGS = {
    'args': args
}
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 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
multistep_lr Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("6a2882fda97658f6")
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 torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Create a small args class with required attributes
class Args:
    def __init__(self):
        self.lr = 0.1
        self.lr_gamma = 0.1
        self.lr_adjust = 30

args = Args()

ARGS = {
    'optimizer': optimizer,
    'args': args
}
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
step_lr Ran
ran; our contract draft was wrong, not the code
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("5bde7897e093d758")
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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Create a minimal config object with required attributes
class Config:
    def __init__(self):
        self.lr = 0.1
        self.epochs = 100

cfg = Config()

ARGS = {
    'optimizer': optimizer,
    'cfg': cfg
}
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
ke_cls_train Not yet run
unverified (harvested, no recorded run)
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("599452487dd6f1fd")
How it ran

no invocation recorded.

resume Not yet run
unverified (harvested, no recorded run)
ahmdtaha/knowledge_evolution/KE_model.py
code served (permissive licence) · get_code("a2c2a12b95bad563")
How it ran

no invocation recorded.

Also present in other papers' code

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

Deep learning relies on the availability of a large corpus of data (labeled or unlabeled). Thus, one challenging unsettled question is: how to train a deep network on a relatively small dataset? To tackle this question, we propose an evolution-inspired training approach to boost performance on relatively small datasets. The knowledge evolution (KE) approach splits a deep network into two hypotheses: the fithypothesis and the reset-hypothesis. We iteratively evolve the knowledge inside the fit-hypothesis by perturbing the reset-hypothesis for multiple generations. This approach not only boosts performance, but also learns a slim network with a smaller inference cost. KE integrates seamlessly with both vanilla and residual convolutional networks. KE reduces both overfitting and the burden for data collection. We evaluate KE on various network architectures and loss functions. We evaluate KE using relatively small datasets (e.g., and randomly initialized deep networks. KE achieves an absolute 21% improvement margin on a state-of-the-art baseline. This performance improvement is accompanied by a relative 73% reduction in inference cost. KE achieves state-of-the-art results on classification and metric learning benchmarks. Code available at http://bit.ly/3uLgwYb

For agents

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

get_harvested_code_for_paper("2103.05152")
get_code_for_paper("2103.05152")
have("2103.05152")

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

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

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

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

Connect an agent — have() is free.