SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.04475 · NeurIPS · 2020

Domain Adaptation with Conditional Distribution Matching and Generalized Label Shift

Remi Tachet, Combes, Han Zhao, D Shaw, Yu-Xiang Wang, Geoff Gordon

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 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; 2 no recorded run), measured 2026-11-21; 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.04475.json · badge: /api/ran/2003.04475.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
timgaripov/asa community
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
Algorithm Ran
ran on a synthesized input · constructed an object; no result was computed
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("abd2c75272446f0b")
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 an instance of its own class, Algorithm: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Define a minimal concrete Algorithm subclass for testing
class ConcreteAlgorithm(nn.Module):
    def __init__(self, input_shape, num_classes, hparams, data_params):
        super(ConcreteAlgorithm, self).__init__()
        self.hparams = hparams
        self.data_params = data_params
        self.input_shape = input_shape
        self.num_classes = num_classes
        self.optimizers = []
        
        # Add a simple model
        self.model = nn.Linear(input_shape[0], num_classes)
        self.optimizer = torch.optim.SGD(self.model.parameters(), lr=0.01)
        self.optimizers.append(self.optimizer)
    
    def update(self, iterator):
        pass
    
    def predict(self, x):
        return self.model(x)

# Define parameters
input_shape = (4,)
num_classes = 3
hparams = {
    "lr": 0.01,
    "batch_size": 2,
    "epochs": 10
}
data_params = {
    "source_domain": "source",
    "target_domain": "target"
}

ARGS = {
    "input_shape": input_shape,
    "num_classes": num_classes,
    "hparams": hparams,
    "data_params": data_params
}
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 Algorithm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Algorithm 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
create_linear_decay_lr_schedule Ran
ran; our contract draft was wrong, not the code
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("84a728cc32e47538")
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

ARGS = {
    "decay_start": 100,
    "decay_steps": 500,
    "decay_factor": 0.1,
}
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
get_optimizer Ran
ran; our contract draft was wrong, not the code
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("01e1e5c155e3406e")
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

torch.manual_seed(0)

# Create a simple model with parameters
model = nn.Linear(4, 3)
params = model.parameters()

# Create optim_config dict with a valid optimizer name and kwargs
optim_config = {
    'name': 'SGD',
    'kwargs': {
        'lr': 0.01,
        'momentum': 0.9
    }
}

ARGS = {
    'params': params,
    'optim_config': optim_config
}
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
process_param_groups Ran
ran; our contract draft was wrong, not the code
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("221a2b83cae89e92")
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 list, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model to generate parameters
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

# Create parameter groups with different factors
param_groups = [
    {
        'params': list(model[0].parameters()),
        'lr_factor': 1.0,
        'wd_factor': 1.0
    },
    {
        'params': list(model[2].parameters()),
        'lr_factor': 0.5,
        'wd_factor': 2.0
    }
]

# Create optimizer config
optim_config = {
    'kwargs': {
        'lr': 0.001,
        'weight_decay': 0.0001
    }
}

ARGS = {
    'param_groups': param_groups,
    'optim_config': optim_config
}
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 list, ndim 1, dtype family float — a list 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
DANetwork Not yet run
unverified (harvested, no recorded run)
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("aa01754b6b04b3a2")
How it ran

no invocation recorded.

IWBase Not yet run
unverified (harvested, no recorded run)
timgaripov/asa/support_alignment/core/algorithms.py
code served (permissive licence) · get_code("05a633b33c7c1fc6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 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
Algorithm
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
DANetwork
brick of this paper's assembly: model
1 other paper
1 dated earlier · 1 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
create_linear_decay_lr_schedule
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
get_optimizer
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
process_param_groups
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks

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

Repositories linked to this paper

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

Abstract

Adversarial learning has demonstrated good performance in the unsupervised domain adaptation setting, by learning domain-invariant representations. However, recent work has shown limitations of this approach when label distributions differ between the source and target domains. In this paper, we propose a new assumption, generalized label shift (GLS), to improve robustness against mismatched label distributions. GLS states that, conditioned on the label, there exists a representation of the input that is invariant between the source and target domains. Under GLS, we provide theoretical guarantees on the transfer performance of any classifier. We also devise necessary and sufficient conditions for GLS to hold, by using an estimation of the relative class weights between domains and an appropriate reweighting of samples. Our weight estimation method could be straightforwardly and generically applied in existing domain adaptation (DA) algorithms that learn domain-invariant representations, with small computational overhead. In particular, we modify three DA algorithms, JAN, DANN and CDAN, and evaluate their performance on standard and artificial DA tasks. Our algorithms outperform the base versions, with vast improvements for large label distribution mismatches. Our code is available at https://tinyurl.com/y585xt6j.

For agents

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

get_harvested_code_for_paper("2003.04475")
get_code_for_paper("2003.04475")
have("2003.04475")

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

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

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

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

Connect an agent — have() is free.