SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.09713 · 2022

A Probabilistic Framework for Lifelong Test-Time Adaptation

arXiv · PDF · Open in the Atlas

Code that ran

5 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 4 have no contract verdict; 1 failure of our instrument; 4 no recorded run), measured 2026-11-23; 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/2212.09713.json · badge: /api/ran/2212.09713.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
dhanajitb/petal canonical (classifier label)
classifier basis not recorded on the link
5 ran · 4 no recorded run
FunctionStatusWhere it lives
find_quantile Ran
ran on a synthesized input
dhanajitb/petal/imagenet/petal.py
code served (permissive licence) · get_code("f54079a9c41b28c2")
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

torch.manual_seed(0)

# Construct arguments for find_quantile
arr = torch.randn(10)  # Small 1D tensor with 10 elements
perc = 0.5  # Percentile value between 0 and 1

ARGS = {
    "arr": arr,
    "perc": perc
}
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
load_imagenet_train Ran
ran on a synthesized input
dhanajitb/petal/imagenet/train-swag-diagonal-imagenet.py
code served (permissive licence) · get_code("0672ea0fb52d2dde")
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 torch
import torch.utils.data as data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from typing import Callable, Dict, Optional, Sequence, Set, Tuple
import tempfile
import os
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a temporary directory structure that mimics ImageNet layout
temp_dir = tempfile.mkdtemp()
train_dir = os.path.join(temp_dir, 'ILSVRC2012_img_train')
os.makedirs(train_dir, exist_ok=True)

# Create a few dummy class directories with dummy images
for class_idx in range(2):
    class_dir = os.path.join(train_dir, f'class_{class_idx:03d}')
    os.makedirs(class_dir, exist_ok=True)
    
    # Create a few dummy images in each class directory
    for img_idx in range(3):
        img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
        img = Image.fromarray(img_array)
        img_path = os.path.join(class_dir, f'image_{img_idx}.jpg')
        img.save(img_path)

ARGS = {
    'n_examples': 2,
    'data_dir': temp_dir,
    'prepr': 'Res256Crop224'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, 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 — 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
read_file Ran
ran on a synthesized input
dhanajitb/petal/imagenet/eval_corruptionwise_img3d.py
code served (permissive licence) · get_code("ee9939f76f4640cd")
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 numpy as np
import re
import tempfile
import os

ordered_corr = ['near_focus', 'far_focus', 'bit_error', 'color_quant', 'flash', 'fog_3d', 'h265_abr', 'h265_crf', 'iso_noise', 'low_light', 'xy_motion_blur', 'z_motion_blur']

# Create a temporary file with the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write 12 lines matching the expected format
# The function expects lines containing 'error : ' with specific structure
lines_data = [
    "some prefix error : [near_focus_1] info accuracy: 95.5%, brightness: 0.8, nll: 0.15",
    "some prefix error : [far_focus_2] info accuracy: 94.2%, brightness: 0.9, nll: 0.18",
    "some prefix error : [bit_error_3] info accuracy: 93.1%, brightness: 0.7, nll: 0.22",
    "some prefix error : [color_quant_4] info accuracy: 92.5%, brightness: 0.85, nll: 0.25",
    "some prefix error : [flash_5] info accuracy: 91.8%, brightness: 0.75, nll: 0.28",
    "some prefix error : [fog_3d_6] info accuracy: 90.9%, brightness: 0.65, nll: 0.30",
    "some prefix error : [h265_abr_7] info accuracy: 89.5%, brightness: 0.88, nll: 0.20",
    "some prefix error : [h265_crf_8] info accuracy: 88.2%, brightness: 0.82, nll: 0.23",
    "some prefix error : [iso_noise_9] info accuracy: 87.1%, brightness: 0.76, nll: 0.26",
    "some prefix error : [low_light_10] info accuracy: 86.5%, brightness: 0.72, nll: 0.29",
    "some prefix error : [xy_motion_blur_11] info accuracy: 85.3%, brightness: 0.80, nll: 0.24",
    "some prefix error : [z_motion_blur_12] info accuracy: 84.1%, brightness: 0.78, nll: 0.27",
]

for line in lines_data:
    temp_file.write(line + '\n')

temp_file.close()

ARGS = {
    'filename': temp_file.name
}
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, 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
read_files Ran
ran on a synthesized input
dhanajitb/petal/imagenet/eval_corruptionwise_img3d.py
code served (permissive licence) · get_code("12bedd590f1cccb3")
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 numpy as np
import tempfile
import os

# Create a temporary file with valid log output matching the expected format
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')

# Write sample log lines that match the parsing logic
# Format: "error : ... ['corruption_name'] ... : accuracy% , : brightness , : nll"
log_content = """
some prefix error : some stuff ['near_focus'] more stuff : 92.5% , : 0.15 , : 1.23
some prefix error : some stuff ['far_focus'] more stuff : 91.3% , : 0.18 , : 1.45
some prefix error : some stuff ['bit_error'] more stuff : 88.9% , : 0.22 , : 1.67
some prefix error : some stuff ['color_quant'] more stuff : 90.1% , : 0.19 , : 1.34
some prefix error : some stuff ['flash'] more stuff : 89.5% , : 0.20 , : 1.56
some prefix error : some stuff ['fog_3d'] more stuff : 87.2% , : 0.25 , : 1.78
some prefix error : some stuff ['h265_abr'] more stuff : 85.6% , : 0.30 , : 1.89
some prefix error : some stuff ['h265_crf'] more stuff : 86.4% , : 0.28 , : 1.92
some prefix error : some stuff ['iso_noise'] more stuff : 84.3% , : 0.35 , : 2.01
some prefix error : some stuff ['low_light'] more stuff : 83.1% , : 0.40 , : 2.15
some prefix error : some stuff ['xy_motion_blur'] more stuff : 82.5% , : 0.45 , : 2.34
some prefix error : some stuff ['z_motion_blur'] more stuff : 81.9% , : 0.50 , : 2.45
"""

temp_file.write(log_content)
temp_file.close()

ARGS = {
    'files': [temp_file.name]
}
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, 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
update_ema_variables Ran
ran; our contract draft was wrong, not the code
dhanajitb/petal/imagenet/petal.py
pointer only (licence: MIT); the stored copy get_code serves, from joe817/gcal, is pointer only (licence: NONE) · get_code("a77d556c0aea19c1")
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 joe817/gcal, 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.

read_file Not yet run
unverified (harvested, no recorded run)
dhanajitb/petal/imagenet/eval_corruptionwise.py
code served (permissive licence) · get_code("253c745e2e017386")
How it ran

no invocation recorded.

read_file_corr Not yet run
unverified (harvested, no recorded run)
dhanajitb/petal/imagenet/eval_corruptionwise.py
code served (permissive licence) · get_code("839f811c5c952569")
How it ran

no invocation recorded.

read_file_corr Not yet run
unverified (harvested, no recorded run)
dhanajitb/petal/imagenet/eval_corruptionwise_img3d.py
code served (permissive licence) · get_code("0891a836fd0057e6")
How it ran

no invocation recorded.

read_files Not yet run
unverified (harvested, no recorded run)
dhanajitb/petal/imagenet/eval_corruptionwise.py
code served (permissive licence) · get_code("dc4b17c489a20513")
How it ran

no invocation recorded.

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 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
update_ema_variables 14 other papers
1 dated earlier, 13 later · 2 only as an assembly brick
2203.13591 (2022-03)
Continual Test-Time Domain Adaptation
2306.04344 (2023-06)
ViDA: Homeostatic Visual Domain Adapter for Continual Test Time Adaptation
2309.14949 (2023-09)
Towards Real-World Test-Time Adaptation: Tri-Net Self-Training with Balanced Normalization
and 11 more not named here

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Test-time adaptation (TTA) is the problem of updating a pre-trained source model at inference time given test input(s) from a different target domain. Most existing TTA approaches assume the setting in which the target domain is stationary, i.e., all the test inputs come from a single target domain. However, in many practical settings, the test input distribution might exhibit a lifelong/continual shift over time. Moreover, existing TTA approaches also lack the ability to provide reliable uncertainty estimates, which is crucial when distribution shifts occur between the source and target domain. To address these issues, we present PETAL (Probabilistic lifElong Test-time Adaptation with seLf-training prior), which solves lifelong TTA using a probabilistic approach, and naturally results in (1) a student-teacher framework, where the teacher model is an exponential moving average of the student model, and (2) regularizing the model updates at inference time using the source model as a regularizer. To prevent model drift in the lifelong/continual TTA setting, we also propose a data-driven parameter restoration technique which contributes to reducing the error accumulation and maintaining the knowledge of recent domains by restoring only the irrelevant parameters. In terms of predictive error rate as well as uncertainty based metrics such as Brier score and negative log-likelihood, our method achieves better results than the current state-of-the-art for online lifelong test-time adaptation across various benchmarks, such as CIFAR-10C, CIFAR-100C, ImageNetC, and ImageNet3DCC datasets. The source code for our approach is accessible at https://github.com/dhanajitb/petal.

For agents

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

get_harvested_code_for_paper("2212.09713")
get_code_for_paper("2212.09713")
have("2212.09713")

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

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

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

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

Connect an agent — have() is free.