SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.08877 · ECCV · 2022

Prior Knowledge Guided Unsupervised Domain Adaptation

Tao Sun, Cheng Lu, Haibin Ling

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 8 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/2207.08877.json · badge: /api/ran/2207.08877.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/KUDA canonical (classifier label)
classifier basis not recorded on the link
11 ran · 2 no recorded run
FunctionStatusWhere it lives
Entropy Ran
ran; our contract draft was wrong, not the code
tsun/KUDA/DINE/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("94b5622f0aa7add1")
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 albert0147/aad_sfda, 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.

PK_loss Ran
ran on a synthesized input
tsun/KUDA/SHOT/loss.py
code served (permissive licence) · get_code("e4ed2051ad0f8c9f")
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)

class MockPKSolver:
    def __init__(self):
        self.N = 10
        # C_abs: list of (c, lb, ub) tuples
        # c is an index, lb and ub are bounds
        self.C_abs = [
            (0, torch.tensor(2.0), torch.tensor(5.0)),
            (1, torch.tensor(1.0), None),
            (2, None, torch.tensor(3.0)),
        ]
        # C_rel: list of (c1, c2, diff) tuples
        self.C_rel = [
            (0, 1, torch.tensor(0.5)),
            (1, 2, torch.tensor(0.3)),
        ]

PK_solver = MockPKSolver()
prob = torch.tensor([0.3, 0.4, 0.2, 0.1])

ARGS = {
    "PK_solver": PK_solver,
    "prob": prob,
}
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
ShearX Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tsun/KUDA/SHOT/augmentations.py
code served (permissive licence) · get_code("815f704e5efd8345")
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 random
import PIL
import PIL.Image
import PIL.ImageOps
import PIL.ImageEnhance
import PIL.ImageDraw

# Create a small PIL Image object to use as the img parameter
# ShearX expects an image with .size attribute and .transform() method
img = PIL.Image.new('RGB', (100, 80))

# v parameter: a float between -0.3 and 0.3
v = 0.15

ARGS = {
    'img': img,
    'v': v
}
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
ShearY Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tsun/KUDA/SHOT/augmentations.py
code served (permissive licence) · get_code("f5e3179cafd9393a")
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 random
import PIL.Image
import PIL.ImageOps
import PIL.ImageEnhance
import PIL.ImageDraw

# Create a simple PIL Image for testing
# The function calls img.size and img.transform(), so we need a valid PIL Image
test_img = PIL.Image.new('RGB', (100, 100), color='red')

# Define arguments for ShearY
ARGS = {
    'img': test_img,
    'v': 0.15
}
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
TranslateX Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tsun/KUDA/SHOT/augmentations.py
code served (permissive licence) · get_code("b2893a9a2ac1188f")
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 random
import PIL
import PIL.Image
import PIL.ImageOps
import PIL.ImageEnhance
import PIL.ImageDraw

# Create a small PIL Image object to pass as the 'img' parameter
# The function uses img.size[0] and img.transform(), so we need a valid PIL Image
test_image = PIL.Image.new('RGB', (100, 80), color='red')

# Define v parameter - must be between -0.45 and 0.45
v_value = 0.3

ARGS = {
    'img': test_image,
    'v': v_value
}
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
grl_hook Ran
ran; our contract draft was wrong, not the code
tsun/KUDA/SHOT/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from Yiyang98/BFUDA, is pointer only (licence: NONE) · get_code("9768efb52f591b55")
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 Yiyang98/BFUDA, 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.

image_train Ran
ran; our contract draft was wrong, not the code
tsun/KUDA/DINE/DINE_dist.py
pointer only (licence: MIT); the stored copy get_code serves, from Albert0147/AaD_SFDA, is pointer only (licence: NONE) · get_code("35c2d572ebd185f5")
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 Albert0147/AaD_SFDA, 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.

l_loader Ran
ran, honoured the contract we drafted
tsun/KUDA/DINE/data_list.py
pointer only (licence: MIT); the stored copy get_code serves, from Albert0147/AaD_SFDA, is pointer only (licence: NONE) · get_code("edd7184ac144c4fa")
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 Albert0147/AaD_SFDA, 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.

lr_scheduler Ran
ran; our contract draft was wrong, not the code
tsun/KUDA/DINE/DINE_dist.py
pointer only (licence: MIT); the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("0b7ffc9f8b77529c")
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 albert0147/aad_sfda, 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.

op_copy Ran
ran; our contract draft was wrong, not the code
tsun/KUDA/DINE/DINE_dist.py
pointer only (licence: MIT); the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("93a11f62e4a129f0")
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 albert0147/aad_sfda, 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.

rgb_loader Ran
ran, honoured the contract we drafted
tsun/KUDA/DINE/data_list.py
code served (permissive licence) · get_code("2c5ce24ea2b5d2a4")
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 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

# Create a temporary RGB image file
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, "test_image.png")

# Create a simple RGB image and save it
img = Image.new('RGB', (10, 10), color=(255, 0, 0))
img.save(temp_image_path)

ARGS = {
    'path': temp_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
calc_coeff Not yet run
unverified (harvested, no recorded run)
tsun/KUDA/SHOT/network.py
pointer only (licence: MIT); the stored copy get_code serves, from Yiyang98/BFUDA, is pointer only (licence: NONE) · get_code("e352afa5762c5a6b")
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 Yiyang98/BFUDA, 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. No invocation recorded.

make_dataset Not yet run
unverified (harvested, no recorded run)
tsun/KUDA/DINE/data_list.py
pointer only (licence: MIT); the stored copy get_code serves, from Albert0147/AaD_SFDA, is pointer only (licence: NONE) · get_code("2301055cb33836bc")
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 Albert0147/AaD_SFDA, 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. No invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 12 are also present in other papers whose code we hold (12 with at least one paper dated earlier, 7 the same month, 12 later) and 1 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
op_copy 21 other papers
8 dated earlier, 1 the same month, 11 later, 1 same year, order not determinable · 5 only as an assembly brick
2002.08546 (2020-02)
Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation
2012.07297 (2020-12)
Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 18 more not named here
rgb_loader 19 other papers
10 dated earlier, 1 the same month, 7 later, 1 same year, order not determinable · 6 only as an assembly brick
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
2104.01845 (2021-04)
Unsupervised Multi-source Domain Adaptation Without Access to Source Data
and 16 more not named here
lr_scheduler 18 other papers
7 dated earlier, 1 the same month, 9 later, 1 same year, order not determinable · 3 only as an assembly brick
2002.08546 (2020-02)
Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation
2012.07297 (2020-12)
Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 15 more not named here
l_loader 17 other papers
8 dated earlier, 1 the same month, 7 later, 1 same year, order not determinable · 5 only as an assembly brick
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
2104.01845 (2021-04)
Unsupervised Multi-source Domain Adaptation Without Access to Source Data
and 14 more not named here
Entropy 16 other papers
8 dated earlier, 1 the same month, 6 later, 1 same year, order not determinable · 4 only as an assembly brick
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
2104.01845 (2021-04)
Unsupervised Multi-source Domain Adaptation Without Access to Source Data
and 13 more not named here
make_dataset 15 other papers
9 dated earlier, 1 the same month, 4 later, 1 same year, order not determinable · 5 only as an assembly brick
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1908.00347 (2019-08)
Central Similarity Quantization for Efficient Image and Video Retrieval
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
and 12 more not named here
calc_coeff 14 other papers
8 dated earlier, 1 the same month, 5 later · 2 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
1904.06487 (2019-04)
Semi-supervised Domain Adaptation via Minimax Entropy
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
and 11 more not named here
grl_hook 12 other papers
8 dated earlier, 4 later · 3 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
and 9 more not named here
image_train 8 other papers
5 dated earlier, 2 later, 1 same year, order not determinable · 2 only as an assembly brick
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
2104.01845 (2021-04)
Unsupervised Multi-source Domain Adaptation Without Access to Source Data
2107.12585 (2021-07)
Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation
and 5 more not named here
ShearX 3 other papers
2 dated earlier, 1 later · 1 only as an assembly brick
1905.00397 (2019-05)
Fast AutoAugment
1909.13719 (2019-09)
RandAugment: Practical automated data augmentation with a reduced search space
2407.18365 (2024-07)
FADAS: Towards Federated Adaptive Asynchronous Optimization
ShearY 3 other papers
2 dated earlier, 1 later · 1 only as an assembly brick
1905.00397 (2019-05)
Fast AutoAugment
1909.13719 (2019-09)
RandAugment: Practical automated data augmentation with a reduced search space
2407.18365 (2024-07)
FADAS: Towards Federated Adaptive Asynchronous Optimization
TranslateX 2 other papers
1 dated earlier, 1 later
1909.13719 (2019-09)
RandAugment: Practical automated data augmentation with a reduced search space
2407.18365 (2024-07)
FADAS: Towards Federated Adaptive Asynchronous Optimization

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

The waive of labels in the target domain makes Unsupervised Domain Adaptation (UDA) an attractive technique in many real-world applications, though it also brings great challenges as model adaptation becomes harder without labeled target data. In this paper, we address this issue by seeking compensation from target domain prior knowledge, which is often (partially) available in practice, e.g., from human expertise. This leads to a novel yet practical setting where in addition to the training data, some prior knowledge about the target class distribution are available. We term the setting as Knowledge-guided Unsupervised Domain Adaptation (KUDA). In particular, we consider two specific types of prior knowledge about the class distribution in the target domain: Unary Bound that describes the lower and upper bounds of individual class probabilities, and Binary Relationship that describes the relations between two class probabilities. We propose a general rectification module that uses such prior knowledge to refine model generated pseudo labels. The module is formulated as a Zero-One Programming problem derived from the prior knowledge and a smooth regularizer. It can be easily plugged into self-training based UDA methods, and we combine it with two state-of-the-art methods, SHOT and DINE. Empirical results on four benchmarks confirm that the rectification module clearly improves the quality of pseudo labels, which in turn benefits the self-training stage. With the guidance from prior knowledge, the performances of both methods are substantially boosted. We expect our work to inspire further investigations in integrating prior knowledge in UDA. Code is available at https://github.com/tsun/KUDA.

For agents

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

get_harvested_code_for_paper("2207.08877")
get_code_for_paper("2207.08877")
have("2207.08877")

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

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

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

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

Connect an agent — have() is free.