SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.06640 · ICML · 2022

Confidence Score for Source-Free Unsupervised Domain Adaptation

Sungroh Yoon, Jonghyun Lee, Dahuin Jung, Junho Yim

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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; 3 failures 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/2206.06640.json · badge: /api/ran/2206.06640.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
jhyun17/cowa-jmds canonical (classifier label)
classifier basis: classifier_2025
4 ran · 4 no recorded run
FunctionStatusWhere it lives
KLLoss Ran
ran; our contract draft was wrong, not the code
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("44c5e921755add5c")
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 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

torch.manual_seed(0)

# Create small tensors for input and target
batch_size = 2
num_classes = 4

input_ = torch.randn(batch_size, num_classes)
target_ = torch.softmax(torch.randn(batch_size, num_classes), dim=1)

# Create coefficient
coeff = torch.tensor(1.0)

# Create args object with epsilon2 attribute
class Args:
    def __init__(self):
        self.epsilon2 = 1e-8

args = Args()

ARGS = {
    "input_": input_,
    "target_": target_,
    "coeff": coeff,
    "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 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
data_load Ran
ran; our contract draft was wrong, not the code
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("1af14a9e9bdb7c5b")
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 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 numpy as np
from torchvision import transforms
from torch.utils.data import DataLoader
from PIL import Image
from torch.utils.data import Dataset
import tempfile
import os

torch.manual_seed(0)

# Create temporary image files for testing
temp_dir = tempfile.mkdtemp()

# Create a simple test image
def create_test_image(path):
    img = Image.new('RGB', (256, 256), color='red')
    img.save(path)

# Create test images
img_paths = []
for i in range(4):
    img_path = os.path.join(temp_dir, f'test_img_{i}.jpg')
    create_test_image(img_path)
    img_paths.append(img_path)

# Create target dataset file
target_file = os.path.join(temp_dir, 'target.txt')
with open(target_file, 'w') as f:
    for i, path in enumerate(img_paths[:2]):
        f.write(f'{path} {i}\n')

# Create test dataset file
test_file = os.path.join(temp_dir, 'test.txt')
with open(test_file, 'w') as f:
    for i, path in enumerate(img_paths[2:]):
        f.write(f'{path} {i}\n')

# Create args object
class Args:
    def __init__(self):
        self.batch_size = 2
        self.t_dset_path = target_file
        self.test_dset_path = test_file
        self.worker = 0

ARGS = {
    'args': Args()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
image_train Ran
ran on a synthesized input
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("d9601c3485e6033d")
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 Compose. 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 numpy as np
from torchvision import transforms

torch.manual_seed(0)

# Define a stand-in Normalize class for the alexnet=True case
class Normalize:
    def __init__(self, meanfile=None):
        self.meanfile = meanfile
    
    def __call__(self, x):
        return x

# Define ARGS with all parameters for image_train
ARGS = {
    'resize_size': 256,
    'crop_size': 224,
    'alexnet': 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 Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
lr_scheduler Ran
ran; our contract draft was wrong, not the code
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("1ee7b6c67ccbf3fb")
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 torch.optim import SGD

torch.manual_seed(0)

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

# Create optimizer with initial lr stored in param_groups
optimizer = SGD(model.parameters(), lr=0.01, momentum=0.9, weight_decay=0.001, nesterov=True)

# Store initial learning rates in param_groups as 'lr0' (required by lr_scheduler)
for param_group in optimizer.param_groups:
    param_group['lr0'] = param_group['lr']

# Create args object with required attributes
class Args:
    def __init__(self):
        self.lr_gamma = 10.0
        self.lr_power = 0.5

args = Args()

# Define all parameters for the function
ARGS = {
    'args': args,
    'optimizer': optimizer,
    'iter_num': 5,
    'max_iter': 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 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
evaluation Not yet run
unverified (harvested, no recorded run)
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("c0f8665d6d8818eb")
How it ran

no invocation recorded.

gmm Not yet run
unverified (harvested, no recorded run)
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("61b5b7339ffd3792")
How it ran

no invocation recorded.

mixup Not yet run
unverified (harvested, no recorded run)
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("522bdfe53eadb6fe")
How it ran

no invocation recorded.

train_target Not yet run
unverified (harvested, no recorded run)
jhyun17/cowa-jmds/image_target_CoWA.py
code served (permissive licence) · get_code("7067da8f4e53c15e")
How it ran

no invocation recorded.

Also present in other papers' code

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

Source-free unsupervised domain adaptation (SFUDA) aims to obtain high performance in the unlabeled target domain using the pre-trained source model, not the source data. Existing SFUDA methods assign the same importance to all target samples, which is vulnerable to incorrect pseudo-labels. To differentiate between sample importance, in this study, we propose a novel sample-wise confidence score, the Joint Model-Data Structure (JMDS) score for SFUDA. Unlike existing confidence scores that use only one of the source or target domain knowledge, the JMDS score uses both knowledge. We then propose a Confidence score Weighting Adaptation using the JMDS (CoWA-JMDS) framework for SFUDA. CoWA-JMDS consists of the JMDS scores as sample weights and weight Mixup that is our proposed variant of Mixup. Weight Mixup promotes the model make more use of the target domain knowledge. The experimental results show that the JMDS score outperforms the existing confidence scores. Moreover, CoWA-JMDS achieves state-of-the-art performance on various SFUDA scenarios: closed, open, and partial-set scenarios. Recently, Deep Neural Networks (DNNs) (LeCun et al., 2015) have successfully demonstrated high performance in various applications. However, if the distribution of the training and test data differs, significant performance degradation occurs, which is known as a domain shift (Pan & Yang, 2009). Unsupervised domain adaptation (UDA) mitigates the domain shift problem using both fully annotated source and unlabeled target data with the assumption that the data distributions in the two domains are slightly differ-

For agents

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

get_harvested_code_for_paper("2206.06640")
get_code_for_paper("2206.06640")
have("2206.06640")

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

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

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

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

Connect an agent — have() is free.