SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2108.08012 · ICCV · 2021

Multi-Anchor Active Domain Adaptation for Semantic Segmentation

Kai Ma, Yefeng Zheng, Munan Ning, Dong Wei, Cheng Bian, Donghuan Lu, Shuang Yu, Chenglang Yuan

arXiv · PDF · Open in the Atlas

Code that ran

9 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 3 failures of our instrument; 3 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/2108.08012.json · badge: /api/ran/2108.08012.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
munanning/mada canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
munanning/madav2 community (classifier label)
classifier basis: plan_row
3 ran · 2 no recorded run
munanning/MADA community
Papers with Code archive
3 ran · 0 no recorded run
FunctionStatusWhere it lives
Class_Features Ran
ran on a synthesized input · constructed an object; no result was computed
munanning/MADA/select_active_samples.py
code served (permissive licence) · get_code("f3a6086bb86995ce")
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, Class_Features: the run constructed the object and did not call it, so no result was computed. 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 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
import numpy as np

torch.manual_seed(0)

# Create a minimal Class_Features instance
class_features_instance = nn.Module()

# Create tensors for the forward pass
batch_size = 2
num_classes = 19
height = 4
width = 3
feature_dim = 256

# Create sample feat_cls (features from some layer)
feat_cls = torch.randn(batch_size, feature_dim, height, width, requires_grad=True)

# Create sample outputs (logits)
outputs = torch.randn(batch_size, num_classes, height, width, requires_grad=True)

# Create sample labels
labels_val = torch.randint(0, num_classes, (batch_size, 1, height, width)).float()

ARGS = {
    "numbers": 19,
}
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 Class_Features — 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 Class_Features 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
NormalisationPoolingFunction Ran
ran on a synthesized input · constructed an object; no result was computed
munanning/MADA/select_active_samples.py
code served (permissive licence) · get_code("daf02aef604440a9")
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, NormalisationPoolingFunction: 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

torch.manual_seed(0)

# Create a small input tensor (batch_size=2, features=4)
input_tensor = torch.randn(2, 4, requires_grad=True)

# Create a scale factor (scalar)
scale_factor = 2.5

ARGS = {
    "input_": input_tensor,
    "scale_factor": scale_factor,
}
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 NormalisationPoolingFunction — 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 NormalisationPoolingFunction 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
bootstrapped_cross_entropy2d Ran
ran on a synthesized input
munanning/mada/loss/loss.py
code served (permissive licence) · get_code("dfe03b9cbc5639c5")
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
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for the function
# input: (batch_size, channels, height, width) = (2, 4, 3, 3)
# target: (batch_size, height, width) = (2, 3, 3)
batch_size = 2
num_channels = 4
height = 3
width = 3

input_tensor = torch.randn(batch_size, num_channels, height, width)
target_tensor = torch.randint(0, 4, (batch_size, height, width))

# K is the number of top-k losses to keep
K = 5

# weight is optional class weights for cross_entropy
weight = torch.tensor([1.0, 1.0, 1.0, 1.0])

ARGS = {
    "input": input_tensor,
    "target": target_tensor,
    "K": K,
    "weight": weight,
    "size_average": True
}
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
cross_entropy2d Ran
ran on a synthesized input
munanning/mada/loss/loss.py
code served (permissive licence) · get_code("57b36a6b7f29df1a")
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
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Create input tensor: (batch=2, channels=4, height=8, width=6)
input_tensor = torch.randn(2, 4, 8, 6)

# Create target tensor: (batch=2, height=8, width=6) with class indices
# Using values in range [0, 3] (valid for 4 classes) and some 250 (ignore_index)
target_tensor = torch.randint(0, 4, (2, 8, 6))
# Add some ignore_index values
target_tensor[0, 0, 0] = 250
target_tensor[1, 1, 1] = 250

# Create weight tensor for classes (4 classes)
weight_tensor = torch.tensor([1.0, 1.2, 0.8, 1.5])

ARGS = {
    'input': input_tensor,
    'target': target_tensor,
    'weight': weight_tensor,
    'size_average': True
}
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
cross_entropy2d Ran
ran on a synthesized input
munanning/madav2/loss/loss.py
code served (permissive licence) · get_code("4865609e5a035433")
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
import torch.nn.functional as F

torch.manual_seed(0)

# Create input tensor: (batch=2, channels=4, height=3, width=5)
input = torch.randn(2, 4, 3, 5)

# Create target tensor: (batch=2, height=3, width=5)
# Values should be class indices, with 255 as ignore_index
target = torch.randint(0, 4, (2, 3, 5))

# Create weight tensor for classes (4 classes)
weight = torch.tensor([1.0, 1.0, 1.0, 1.0])

ARGS = {
    "input": input,
    "target": target,
    "weight": weight,
    "size_average": True,
}
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
get_norm_layer Ran
ran; our contract draft was wrong, not the code
munanning/madav2/models/networks.py
pointer only (licence: MIT); the stored copy get_code serves, from xiwei-cheng/chained_ld, is pointer only (licence: NONE) · get_code("05f3653dd76468d9")
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 xiwei-cheng/chained_ld, 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.

get_scheduler Ran
ran; our contract draft was wrong, not the code
munanning/mada/models/networks.py
pointer only (licence: MIT); the stored copy get_code serves, from sak-h/pytorch-Denoising-Diffusion-Probabilistic-Models, is pointer only (licence: NONE) · get_code("62a8cdfdb51ec275")
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 sak-h/pytorch-Denoising-Diffusion-Probabilistic-Models, 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.

init_net Ran
ran; our contract draft was wrong, not the code
munanning/madav2/models/networks.py
pointer only (licence: MIT); the stored copy get_code serves, from amandinebtto/batvision-dataset, is pointer only (licence: CC-BY-SA-4.0) · get_code("bf329cef80ee24c5")
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 amandinebtto/batvision-dataset, and CC-BY-SA-4.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

normalisation_pooling Ran
ran on a synthesized input
munanning/MADA/select_active_samples.py
code served (permissive licence) · get_code("9032dc1e1e618038")
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 2, 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

class NormalisationPoolingFunction(torch.autograd.Function):

    @staticmethod
    def forward(ctx, input_, scale_factor):
        ctx.scale_factor = scale_factor
        return input_ * 1

    @staticmethod
    def backward(ctx, grad_output):
        scale_factor = ctx.scale_factor
        grad_input = grad_output * scale_factor
        return (grad_input, None)

class normalisation_pooling(nn.Module):

    def __init__(self):
        super(normalisation_pooling, self).__init__()

    def forward(self, input, scale_factor):
        return NormalisationPoolingFunction.apply(input, scale_factor)


INIT_ARGS = {}

ARGS = {
    'input': torch.randn(2, 4),
    'scale_factor': 2.5
}

if __name__ == '__main__':
    module = normalisation_pooling(**INIT_ARGS)
    output = module(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
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 2, 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)
get_criterion Not yet run
unverified (harvested, no recorded run)
munanning/madav2/loss/loss.py
code served (permissive licence) · get_code("8a376f4180e6fb9c")
How it ran

no invocation recorded.

multi_scale_cross_entropy2d Not yet run
unverified (harvested, no recorded run)
munanning/mada/loss/loss.py
code served (permissive licence) · get_code("6ceebb622653f267")
How it ran

no invocation recorded.

multi_scale_cross_entropy2d Not yet run
unverified (harvested, no recorded run)
munanning/madav2/loss/loss.py
code served (permissive licence) · get_code("02c66a386abd9218")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
init_net 14 other papers
9 dated earlier, 5 later
1406.2661 (2014-06)
Generative Adversarial Networks
1511.06434 (2015-11)
Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
and 11 more not named here
get_scheduler 11 other papers
8 dated earlier, 2 later, 1 same year, order not determinable
1406.2661 (2014-06)
Generative Adversarial Networks
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1907.04312 (2019-07)
Positional Normalization
and 8 more not named here
get_norm_layer 4 other papers
3 dated earlier, 1 later
1807.09251 (2018-07)
GANimation: Anatomically-aware Facial Animation from a Single Image
1907.05600 (2019-07)
Generative Modeling by Estimating Gradients of the Data Distribution
1910.13049 (2019-10)
Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation
and 1 more not named here
bootstrapped_cross_entropy2d 2 other papers
2 dated earlier
1910.13049 (2019-10)
Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation
2006.00176 (2020-06)
When2com: Multi-Agent Perception via Communication Graph Grouping
cross_entropy2d 1 other paper
1 dated earlier
1910.13049 (2019-10)
Category Anchor-Guided Unsupervised Domain Adaptation for Semantic Segmentation
multi_scale_cross_entropy2d 1 other paper
1 dated earlier
1910.13049 (2019-10)
Category Anchor-Guided Unsupervised 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-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

Unsupervised domain adaption has proven to be an effective approach for alleviating the intensive workload of manual annotation by aligning the synthetic source-domain data and the real-world target-domain samples. Unfortunately, mapping the target-domain distribution to the source-domain unconditionally may distort the essential structural information of the target-domain data. To this end, we firstly propose to introduce a novel multi-anchor based active learning strategy to assist domain adaptation regarding the semantic segmentation task. By innovatively adopting multiple anchors instead of a single centroid, the source domain can be better characterized as a multimodal distribution, thus more representative and complimentary samples are selected from the target domain. With little workload to manually annotate these active samples, the distortion of the target-domain distribution can be effectively alleviated, resulting in a large performance gain. The multi-anchor strategy is additionally employed to model the target-distribution. By regularizing the latent representation of the target samples compact around multiple anchors through a novel soft alignment loss, more precise segmentation can be achieved. Extensive experiments are conducted on public datasets to demonstrate that the proposed approach outperforms state-of-the-art methods significantly, along with thorough ablation study to verify the effectiveness of each component. The code will be released soon at https://github.com/munanning/MADA.

For agents

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

get_harvested_code_for_paper("2108.08012")
get_code_for_paper("2108.08012")
have("2108.08012")

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

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

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

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

Connect an agent — have() is free.