SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper · ICCV · 2023

Local Context-Aware Active Domain Adaptation

Tao Sun, Cheng Lu, Haibin Ling

Open in the Atlas

Code that ran

6 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; 1 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 2 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper.json · badge: /api/ran/Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper.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
tsun/LADA canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
ActualSequentialLoader Ran
ran on a synthesized input
tsun/LADA/active/utils.py
code served (permissive licence) · get_code("26f08e88a1ff66b5")
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
from torch.utils.data import Dataset, DataLoader
from torch.utils.data.sampler import Sampler
import copy

torch.manual_seed(0)

# Create a minimal Dataset
class DummyDataset(Dataset):
    def __init__(self, size=8, dim=4):
        self.data = torch.randn(size, dim)
        self.labels = torch.randint(0, 2, (size,))
        self.transform = None
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        x = self.data[idx]
        y = self.labels[idx]
        if self.transform is not None:
            x = self.transform(x)
        return x, y

# Create a minimal sampler with indices attribute
class DummySampler(Sampler):
    def __init__(self, indices):
        self.indices = indices
    
    def __iter__(self):
        return iter(self.indices)
    
    def __len__(self):
        return len(self.indices)

# Create a dummy DataLoader (subsetRandomLoader)
dataset = DummyDataset(size=8, dim=4)
indices = list(range(8))
sampler = DummySampler(indices)
subsetRandomLoader = DataLoader(
    dataset,
    sampler=sampler,
    batch_size=2,
    num_workers=0,
    drop_last=False
)

# Define transform (optional parameter)
def dummy_transform(x):
    return x * 2

# Build ARGS
ARGS = {
    "subsetRandomLoader": subsetRandomLoader,
    "indices": [0, 1, 2, 3],
    "transform": dummy_transform,
    "batch_size": 2
}
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
outer_product_opt Ran
ran, honoured the contract we drafted
tsun/LADA/active/utils.py
code served (permissive licence) · get_code("243f652b58f07018")
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 (2, 3) 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 numpy as np

# Create small test arrays with distinct dimensions
np.random.seed(0)

# c1: shape (B1, D) where B1=2, D=4
c1 = np.random.randn(2, 4).astype(np.float32)

# d1: shape (B1, D) where B1=2, D=4
d1 = np.random.randn(2, 4).astype(np.float32)

# c2: shape (B2, D) where B2=3, D=4
c2 = np.random.randn(3, 4).astype(np.float32)

# d2: shape (B2, D) where B2=3, D=4
d2 = np.random.randn(3, 4).astype(np.float32)

ARGS = {
    "c1": c1,
    "d1": d1,
    "c2": c2,
    "d2": d2,
}
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 ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
pil_loader Ran
ran on a synthesized input
tsun/LADA/dataset/image_list.py
code served (permissive licence) · get_code("c9b377e893d5825f")
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 Image. 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 tempfile
import os
from PIL import Image
import os.path as osp

# Create a temporary directory and a valid test image
temp_dir = tempfile.mkdtemp()

# Create a simple RGB image and save it
test_image = Image.new('RGB', (10, 10), color='red')
test_image_path = osp.join(temp_dir, 'test_image.png')
test_image.save(test_image_path)

# Define arguments for pil_loader
ARGS = {
    'root': temp_dir,
    'path': 'test_image.png'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
register_model Ran
ran; our contract draft was wrong, not the code
tsun/LADA/model/models.py
code served (permissive licence) · get_code("8fadf1baab2bb38b")
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

torch.manual_seed(0)

# The register_model function is a decorator factory that takes a name parameter
# and returns a decorator that registers a class in the models dict.
# 
# Looking at the function body:
# - It takes one parameter: name (a string)
# - The decorator takes a cls parameter (a class)
# - It stores cls in models[name]
# - It returns cls
#
# To construct valid arguments, we need to provide a name to register_model.

name = "test_model"

ARGS = {
    "name": name
}
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
register_strategy Ran
ran on a synthesized input
tsun/LADA/active/sampler.py
code served (permissive licence) · get_code("37dd93cc2f3a2f57")
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

al_dict = {}

def register_strategy(name):
    def decorator(cls):
        al_dict[name] = cls
        return cls
    return decorator

# Create a simple test class to register
class SimpleStrategy:
    pass

# Define ARGS with the parameter 'name'
ARGS = {
    'name': 'test_strategy'
}
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
row_norms Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tsun/LADA/active/utils.py
code served (permissive licence) · get_code("e7ced40f3c7dbf28")
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 1, dtype family float, shape (2,) 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 numpy as np

# Create a small sample array for X
X = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float64)

ARGS = {
    'X': X,
    'squared': False
}
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 ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
get_model Not yet run
unverified (harvested, no recorded run)
tsun/LADA/model/models.py
code served (permissive licence) · get_code("2efe87863253f8ba")
How it ran

no invocation recorded.

get_strategy Not yet run
unverified (harvested, no recorded run)
tsun/LADA/active/sampler.py
code served (permissive licence) · get_code("dbcd7c2c6017db5f")
How it ran

no invocation recorded.

make_dataset Not yet run
unverified (harvested, no recorded run)
tsun/LADA/dataset/image_list.py
code served (permissive licence) · get_code("2ff45fe3bc074ae1")
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 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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
get_model 4 other papers
4 dated earlier
1711.03213 (2017-11)
CyCADA: Cycle-Consistent Adversarial Domain Adaptation
2003.00820 (2020-03)
MADAN: Multi-source Adversarial Domain Aggregation Network for Domain Adaptation
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
and 1 more not named here
register_model 3 other papers
3 dated earlier
1711.03213 (2017-11)
CyCADA: Cycle-Consistent Adversarial Domain Adaptation
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
row_norms 3 other papers
3 dated earlier
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
2202.06484 (2022-02)
D2ADA: Dynamic Density-aware Active Domain Adaptation for Semantic Segmentation
get_strategy 2 other papers
2 dated earlier
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
outer_product_opt 2 other papers
2 dated earlier
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
register_strategy 2 other papers
2 dated earlier
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings

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

Repositories linked to this paper

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

Abstract

Active Domain Adaptation (ADA) queries the labels of a small number of selected target samples to help adapting a model from a source domain to a target domain. The local context of queried data is important, especially when the domain gap is large. However, this has not been fully explored by existing ADA works. In this paper, we propose a Local context-aware ADA framework, named LADA, to address this issue. To select informative target samples, we devise a novel criterion based on the local inconsistency of model predictions. Since the labeling budget is usually small, fine-tuning model on only queried data can be inefficient. We progressively augment labeled target data with the confident neighbors in a class-balanced manner. Experiments validate that the proposed criterion chooses more informative target samples than existing active selection strategies. Furthermore, our full method clearly surpasses recent ADA arts on various benchmarks. Code is available at https://github.com/tsun/LADA.

For agents

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

get_harvested_code_for_paper("Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper")
get_code_for_paper("Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper")
have("Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper")

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

curl https://syntology.ai/api/ran/Sun_Local_Context-Aware_Active_Domain_Adaptation_ICCV_2023_paper.json

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

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

Connect an agent — have() is free.