SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.02541 · 2020

A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation

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; 2 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 4 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/2003.02541.json · badge: /api/ran/2003.02541.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
tim-learn/BA3US canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
FunctionStatusWhere it lives
DANN Ran
ran on a synthesized input
tim-learn/BA3US/my_loss.py
code served (permissive licence) · get_code("b03644ad1b258f7e")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a small ad_net model that takes features and outputs binary predictions
class ADNet(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return torch.sigmoid(self.linear(x))

# Create small tensors and models
batch_size = 2
feature_dim = 4
len_share = 0

# features: shape (4, 4) - batch of 4 samples with 4 features each
# This represents: train_bs=2 source, train_bs=2 target (since len_share=0)
features = torch.randn(4, 4)

# ad_net: outputs binary scores for discriminator
ad_net = ADNet(input_dim=4, output_dim=1)

# entropy: optional tensor with shape matching ad_out
entropy = torch.randn(4, 1, requires_grad=True)

# coeff: scalar coefficient for gradient reversal
coeff = 0.1

# cls_weight: scalar weight for classification
cls_weight = torch.tensor(1.0)

ARGS = {
    "features": features,
    "ad_net": ad_net,
    "entropy": entropy,
    "coeff": coeff,
    "cls_weight": cls_weight,
    "len_share": len_share,
}
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 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
Entropy Ran
ran on a synthesized input
tim-learn/BA3US/my_loss.py
code served (permissive licence) · get_code("792f32c0291a5af7")
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 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 torch

torch.manual_seed(0)

# The function expects input_ to be a tensor with:
# - .size(0) method (batch size dimension)
# - Support for element-wise operations (* and torch.log)
# - torch.sum with dim parameter
# Based on the code, it appears to be a probability distribution (values in [0,1])
# with shape (batch_size, num_classes)

input_tensor = torch.rand(2, 4)  # batch_size=2, num_classes=4, values in [0,1]

ARGS = {
    "input_": input_tensor
}
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 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
grl_hook Ran
ran; our contract draft was wrong, not the code
tim-learn/BA3US/my_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_test Ran
ran; our contract draft was wrong, not the code
tim-learn/BA3US/run_partial.py
code served (permissive licence) · get_code("60166088c825b407")
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
from torchvision import transforms

torch.manual_seed(0)

ARGS = {
    "resize_size": 256,
    "crop_size": 224,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
image_train Ran
ran; our contract draft was wrong, not the code
tim-learn/BA3US/run_partial.py
code served (permissive licence) · get_code("6d14e3fcb8d93fa1")
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
from torchvision import transforms

torch.manual_seed(0)

ARGS = {
    "resize_size": 256,
    "crop_size": 224,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
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
inv_lr_scheduler Ran
ran; our contract draft was wrong, not the code
tim-learn/BA3US/lr_schedule.py
code served (permissive licence) · get_code("693fef7015113684")
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
import torch.optim as optim

torch.manual_seed(0)

# Create a small model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.fc(x)

model = SimpleModel()

# Create optimizer with param_groups that have lr_mult and decay_mult
optimizer = optim.SGD([
    {'params': model.fc.weight, 'lr_mult': 1.0, 'decay_mult': 1.0},
    {'params': model.fc.bias, 'lr_mult': 2.0, 'decay_mult': 0.5}
], lr=0.001, weight_decay=0.0005)

ARGS = {
    'optimizer': optimizer,
    'iter_num': 100,
    'gamma': 0.0001,
    'power': 0.75,
    'lr': 0.001,
    'weight_decay': 0.0005
}
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
l_loader Ran
ran, honoured the contract we drafted
tim-learn/BA3US/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.

rgb_loader Ran
ran, honoured the contract we drafted
tim-learn/BA3US/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)
tim-learn/BA3US/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)
tim-learn/BA3US/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 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, 8 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 8 later) and 2 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
rgb_loader 19 other papers
19 later · 6 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
2106.06916 (2021-06)
Non-Transferable Learning: A New Approach for Model Ownership Verification and Applicability Authorization
and 16 more not named here
l_loader 17 other papers
17 later · 5 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 14 more not named here
make_dataset 15 other papers
2 dated earlier, 13 later · 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
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 12 more not named here
calc_coeff 14 other papers
2 dated earlier, 12 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
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
and 11 more not named here
grl_hook 12 other papers
1 dated earlier, 11 later · 3 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
2008.01454 (2020-08)
Learning from a Complementary-label Source Domain: Theory and Algorithms
and 9 more not named here
inv_lr_scheduler 4 other papers
4 later · 1 only as an assembly brick
2104.00808 (2021-04)
Curriculum Graph Co-Teaching for Multi-Target Domain Adaptation
2108.09645 (2021-08)
Improving Mini-batch Optimal Transport via Partial Transportation
2402.01887 (2024-02)
On f -Divergence Principled Domain Adaptation: An Improved Framework
and 1 more not named here
image_test 1 other paper
1 later
2108.09645 (2021-08)
Improving Mini-batch Optimal Transport via Partial Transportation
image_train 1 other paper
1 later
2108.09645 (2021-08)
Improving Mini-batch Optimal Transport via Partial Transportation

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

This work addresses the unsupervised domain adaptation problem, especially in the case of class labels in the target domain being only a subset of those in the source domain. Such a partial transfer setting is realistic but challenging and existing methods always suffer from two key problems, negative transfer and uncertainty propagation. In this paper, we build on domain adversarial learning and propose a novel domain adaptation method BA$^3$US with two new techniques termed Balanced Adversarial Alignment (BAA) and Adaptive Uncertainty Suppression (AUS), respectively. On one hand, negative transfer results in misclassification of target samples to the classes only present in the source domain. To address this issue, BAA pursues the balance between label distributions across domains in a fairly simple manner. Specifically, it randomly leverages a few source samples to augment the smaller target domain during domain alignment so that classes in different domains are symmetric. On the other hand, a source sample would be denoted as uncertain if there is an incorrect class that has a relatively high prediction score, and such uncertainty easily propagates to unlabeled target data around it during alignment, which severely deteriorates adaptation performance. Thus we present AUS that emphasizes uncertain samples and exploits an adaptive weighted complement entropy objective to encourage incorrect classes to have uniform and low prediction scores. Experimental results on multiple benchmarks demonstrate our BA$^3$US surpasses state-of-the-arts for partial domain adaptation tasks. Code is available at \url{https://github.com/tim-learn/BA3US}.

For agents

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

get_harvested_code_for_paper("2003.02541")
get_code_for_paper("2003.02541")
have("2003.02541")

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

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

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

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

Connect an agent — have() is free.