SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.00820 · NeurIPS · 2020

MADAN: Multi-source Adversarial Domain Aggregation Network for Domain Adaptation

Kurt Keutzer, Bo Li, Sicheng Zhao, Xiangyu Yue, Pengfei Xu, Zhao

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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 1 has no contract verdict; 1 failure of our instrument; 3 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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.00820.json · badge: /api/ran/2003.00820.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
Luodian/MADAN canonical (classifier label)
classifier basis: classifier_2025
3 ran · 2 no recorded run
copy not recorded community
not in the paper's declared repositories
0 ran · 1 no recorded run
FunctionStatusWhere it lives
to_tensor_raw Ran
ran, honoured the contract we drafted
Luodian/MADAN/scripts/train_fcn.py
code served (permissive licence) · get_code("21b188a4406f5a30")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family int, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T22:51:55Z). 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

torch.manual_seed(0)

# The function to_tensor_raw takes an image-like object (im)
# and converts it to a torch tensor via numpy
# It calls np.array(im, np.int64, copy=False) and then torch.from_numpy()
# So 'im' should be something that can be converted to a numpy array

# Create a simple image-like object - a list or numpy array
im = np.array([[1, 2, 3, 4], [5, 6, 7, 8]], dtype=np.int64)

ARGS = {
    "im": im
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 2, dtype family int, shape (2, 4) — shape (2, 4) 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
ImagePool Ran
ran on a synthesized input
Luodian/MADAN/cyclegan/models/multi_cycle_gan_semantic_model.py
code served (permissive licence) · get_code("e4a4daa9f574a3a3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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 random

class ImagePool:

    def __init__(self, pool_size):
        self.pool_size = pool_size
        if self.pool_size > 0:
            self.num_imgs = 0
            self.images = []

    def query(self, images):
        if self.pool_size == 0:
            return images
        return_images = []
        for image in images:
            image = torch.unsqueeze(image.data, 0)
            if self.num_imgs < self.pool_size:
                self.num_imgs = self.num_imgs + 1
                self.images.append(image)
                return_images.append(image)
            else:
                p = random.uniform(0, 1)
                if p > 0.5:
                    random_id = random.randint(0, self.pool_size - 1)
                    tmp = self.images[random_id].clone()
                    self.images[random_id] = image
                    return_images.append(tmp)
                else:
                    return_images.append(image)
        return_images = torch.cat(return_images, 0)
        return return_images


INIT_ARGS = {
    'pool_size': 4
}

ARGS = {
    'images': torch.randn(2, 3, 8, 8)
}

METHOD = 'query'

if __name__ == '__main__':
    pool = ImagePool(**INIT_ARGS)
    result = pool.query(**ARGS)
    print(f"Result shape: {result.shape}")
    print(f"Pool size: {pool.pool_size}")
    print(f"Num images in pool: {pool.num_imgs}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 4, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
supervised_loss Ran
ran; our contract draft was wrong, not the code
Luodian/MADAN/scripts/train_fcn.py
code served (permissive licence) · get_code("ed35488af2926773")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Create score tensor: (batch_size, num_classes, height, width)
# NLLLoss2d expects log probabilities of shape (N, C, H, W)
score = torch.randn(2, 4, 3, 5)

# Create label tensor: (batch_size, height, width)
# Labels should be class indices, with 255 as ignore_index
label = torch.randint(0, 4, (2, 3, 5))
label[0, 0, 0] = 255  # Set one pixel to ignore_index

# Create weights for classes (optional, but we'll provide it)
weights = torch.tensor([1.0, 1.0, 1.0, 1.0])

ARGS = {
    "score": score,
    "label": label,
    "weights": weights,
}
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
BaseModel Not yet run
unverified (harvested, no recorded run)
Luodian/MADAN/cyclegan/models/multi_cycle_gan_semantic_model.py
code served (permissive licence) · get_code("aa07d24d8087a985")
How it ran

no invocation recorded.

CycleGANSemanticModel Not yet run
unverified (harvested, no recorded run)
Luodian/MADAN/cyclegan/models/multi_cycle_gan_semantic_model.py
code served (permissive licence) · get_code("aac5528a8d4646be")
How it ran

no invocation recorded.

get_model Not yet run
unverified (harvested, no recorded run)
this paper's copy was not recorded; identical code first harvested from jhoffman/cycada_release
pointer only · get_code("2efe87863253f8ba")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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 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, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 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
get_model
brick of this paper's assembly: helper
4 other papers
1 dated earlier, 3 later
1711.03213 (2017-11)
CyCADA: Cycle-Consistent Adversarial Domain Adaptation
2010.08666 (2020-10)
Active Domain Adaptation via Clustering Uncertainty-weighted Embeddings
and 1 more not named here
ImagePool
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2110.12467 (2021-10)
Robustness via Uncertainty-aware Cycle Consistency
2403.20142 (2024-03)
StegoGAN: Leveraging Steganography for Non-Bijective Image-to-Image Translation
supervised_loss 1 other paper
1 dated earlier
1910.12181 (2019-10)
Multi-source Domain Adaptation for Semantic Segmentation
to_tensor_raw 1 other paper
1 dated earlier
1910.12181 (2019-10)
Multi-source Domain Adaptation for Semantic Segmentation

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

Domain adaptation aims to learn a transferable model to bridge the domain shift between one labeled source domain and another sparsely labeled or unlabeled target domain. Since the labeled data may be collected from multiple sources, multi-source domain adaptation (MDA) has attracted increasing attention. Recent MDA methods do not consider the pixel-level alignment between sources and target or the misalignment across different sources. In this paper, we propose a novel MDA framework to address these challenges. Specifically, we design an end-to-end Multi-source Adversarial Domain Aggregation Network (MADAN). First, an adapted domain is generated for each source with dynamic semantic consistency while aligning towards the target at the pixel-level cycle-consistently. Second, sub-domain aggregation discriminator and cross-domain cycle discriminator are proposed to make different adapted domains more closely aggregated. Finally, feature-level alignment is performed between the aggregated domain and the target domain while training the task network. For the segmentation adaptation, we further enforce category-level alignment and incorporate context-aware generation, which constitutes MADAN+. We conduct extensive MDA experiments on digit recognition, object classification, and simulation-to-real semantic segmentation. The results demonstrate that the proposed MADAN and MANDA+ models outperform state-of-the-art approaches by a large margin.

For agents

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

get_harvested_code_for_paper("2003.00820")
get_code_for_paper("2003.00820")
have("2003.00820")

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

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

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

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

Connect an agent — have() is free.