SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2009.12518 · 2020

Unsupervised Model Adaptation for Continual Semantic Segmentation

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 0 honoured the contract we drafted, 0 violated it and 10 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2009.12518.json · badge: /api/ran/2009.12518.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
serbanstan/mas3-continual community (classifier label)
classifier basis not recorded on the link
10 ran · 3 no recorded run
FunctionStatusWhere it lives
classifier_layers Ran
ran on a synthesized input
serbanstan/mas3-continual/networks.py
code served (permissive licence) · get_code("a82af9c8599a81fc")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 5) 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 tensorflow as tf
import numpy as np

# Create a small embedding tensor
# Shape: (batch_size, height, width, channels)
# The function expects embedding.shape[-1] == num_classes
batch_size = 2
height = 4
width = 3
num_classes = 5

embedding = tf.constant(
    np.random.randn(batch_size, height, width, num_classes).astype(np.float32)
)

ARGS = {
    'embedding': embedding,
    'num_classes': num_classes,
    'activation': 'softmax'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 5) — shape (2, 4, 3, 5) 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
generateTheta Ran
ran on a synthesized input
serbanstan/mas3-continual/wasserstein_utils.py
code served (permissive licence) · get_code("d2ba47eff84665bb")
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 ndarray, ndim 2, dtype family float, shape (5, 3) 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 numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# The function takes two parameters:
# L: number of rows (integer)
# endim: number of columns / embedding dimension (integer)

L = 5
endim = 3

ARGS = {
    "L": L,
    "endim": endim
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 3) 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
masked_ce_loss Ran
ran on a synthesized input
serbanstan/mas3-continual/losses.py
code served (permissive licence) · get_code("f6d33fc599184192")
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 numpy as np
import tensorflow as tf

# Set seeds for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create sample data for testing the masked_ce_loss function
batch_size = 2
num_classes = 20

# y_true: one-hot encoded labels (batch_size, num_classes)
y_true = np.zeros((batch_size, num_classes), dtype='float32')
y_true[0, 5] = 1.0
y_true[1, 10] = 1.0

# y_pred: prediction logits or probabilities (batch_size, num_classes)
y_pred = np.random.randn(batch_size, num_classes).astype('float32')

# Convert to TensorFlow tensors
y_true_tf = tf.constant(y_true)
y_pred_tf = tf.constant(y_pred)

ARGS = {
    'num_classes': 20,
    'class_to_ignore': 0,
    'from_logits': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
oneDWassersteinV3 Ran
ran on a synthesized input
serbanstan/mas3-continual/wasserstein_utils.py
code served (permissive licence) · get_code("5faf05c7c0b22842")
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 EagerTensor, ndim 1, dtype family float, shape (4,) 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 tensorflow as tf
import numpy as np

# Create small sample tensors for p and q
# The function expects 2D tensors where axis=0 is the batch dimension
np.random.seed(0)
p = tf.constant(np.random.randn(2, 4).astype(np.float32))
q = tf.constant(np.random.randn(3, 4).astype(np.float32))

ARGS = {
    "p": p,
    "q": q,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 1, dtype family float, shape (4,) — shape (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
read_and_reshape Ran
ran on a synthesized input
serbanstan/mas3-continual/io_utils.py
code served (permissive licence) · get_code("84cfa97fdf27f99f")
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 tuple, 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 numpy as np
import tempfile
import os
from PIL import Image as PILImage

# Create temporary directory for test images
temp_dir = tempfile.mkdtemp()

# Create a small test image (PNG format)
img_array = np.random.randint(0, 256, size=(512, 1024, 3), dtype=np.uint8)
img_pil = PILImage.fromarray(img_array)
img_path = os.path.join(temp_dir, 'test_img.png')
img_pil.save(img_path, format='PNG')

# Create a small test labels image (PNG format)
labels_array = np.random.randint(0, 20, size=(512, 1024), dtype=np.uint8)
labels_pil = PILImage.fromarray(labels_array)
labels_path = os.path.join(temp_dir, 'test_labels.png')
labels_pil.save(labels_path, format='PNG')

ARGS = {
    'img_path': img_path,
    'labels_path': labels_path,
    'img_shape': (1024, 512),
    'dataset': 'CITYSCAPES'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, imageio, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
read_image Ran
ran on a synthesized input
serbanstan/mas3-continual/io_utils.py
code served (permissive licence) · get_code("6a057502641c5c29")
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 ndarray, ndim 3, dtype family float, shape (224, 224, 3) 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 tempfile
import numpy as np
import os

# Create a temporary .npy file with dummy image data
temp_dir = tempfile.mkdtemp()
dummy_image = np.random.randint(0, 256, size=(224, 224, 3), dtype=np.uint8).astype(np.float32)
img_path = os.path.join(temp_dir, "test_image.npy")
np.save(img_path, dummy_image)

ARGS = {
    "img_path": img_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (224, 224, 3) — shape (224, 224, 3) 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
read_label Ran
ran on a synthesized input
serbanstan/mas3-continual/io_utils.py
code served (permissive licence) · get_code("1ea07d8dc81db6f5")
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 ndarray, ndim 1, dtype family int, shape (5,) 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 numpy as np
import tempfile
import os

# Create a temporary .npy file
temp_dir = tempfile.mkdtemp()
temp_label_path = os.path.join(temp_dir, "label.npy")
temp_label_data = np.array([1, 2, 3, 4, 5], dtype=np.int32)
np.save(temp_label_path, temp_label_data)

ARGS = {
    "label_path": temp_label_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (5,) — shape (5,) 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
sWasserstein_hd Ran
ran on a synthesized input
serbanstan/mas3-continual/wasserstein_utils.py
code served (permissive licence) · get_code("6be678cec69c4ef0")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)

# Create small test tensors
# P: shape (batch_size * nclass,) -> reshaped to (-1, nclass)
# Q: same shape as P
# theta: shape (feature_dim, nclass)

batch_size = 2
nclass = 3
feature_dim = 4

# P and Q are flattened representations that will be reshaped to (-1, nclass)
# So total elements should be batch_size * nclass
P = tf.constant(np.random.randn(batch_size * nclass), dtype=tf.float32)
Q = tf.constant(np.random.randn(batch_size * nclass), dtype=tf.float32)

# theta is a random matrix of directions with shape (feature_dim, nclass)
theta = tf.constant(np.random.randn(feature_dim, nclass), dtype=tf.float32)

ARGS = {
    'P': P,
    'Q': Q,
    'theta': theta,
    'nclass': nclass,
    'Cp': None,
    'Cq': None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
sample_from_gaussians Ran
ran on a synthesized input
serbanstan/mas3-continual/utils.py
code served (permissive licence) · get_code("e32752b51633335e")
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 tuple. 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 numpy as np

# Set seed for reproducibility
np.random.seed(42)

# Create sample means (3 Gaussians, each with dimension 4)
means = [
    np.array([0.0, 0.0, 0.0, 0.0]),
    np.array([1.0, 1.0, 1.0, 1.0]),
    np.array([2.0, 2.0, 2.0, 2.0])
]

# Create sample covariance matrices (3x4x4, identity-based)
covs = [
    np.eye(4),
    np.eye(4) * 1.5,
    np.eye(4) * 2.0
]

# Create n_samples array: first element must be 0 (as per assertion)
# Sample 0 from first Gaussian, 3 from second, 2 from third
n_samples = np.array([0, 3, 2])

ARGS = {
    "means": means,
    "covs": covs,
    "n_samples": n_samples
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
weighted_ce_loss Ran
ran on a synthesized input
serbanstan/mas3-continual/losses.py
code served (permissive licence) · get_code("e21bd1a46c993988")
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 numpy as np
import tensorflow as tf

def weighted_ce_loss(num_classes=20, class_to_ignore=0):
    mask = np.ones(num_classes)
    mask[class_to_ignore] = 0
    mask = tf.keras.backend.variable(mask, dtype='float32')

    def wce_loss(y_true, y_pred, from_logits=True):
        if from_logits == True:
            y_pred = tf.keras.backend.softmax(y_pred, axis=-1)
        y_pred = tf.clip_by_value(y_pred, 1e-10, 1)
        loss = tf.keras.backend.categorical_crossentropy(y_true * mask, y_pred, axis=-1)
        return tf.keras.backend.mean(loss)
    return wce_loss

# Setup for weighted_ce_loss function
num_classes_val = 5
class_to_ignore_val = 0

ARGS = {
    'num_classes': num_classes_val,
    'class_to_ignore': class_to_ignore_val
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — 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
deeplabv3 Not yet run
unverified (harvested, no recorded run)
serbanstan/mas3-continual/deeplabv3.py
code served (permissive licence) · get_code("7628a94d3f5f0657")
How it ran

no invocation recorded.

resnet101_backbone Not yet run
unverified (harvested, no recorded run)
serbanstan/mas3-continual/deeplabv3.py
code served (permissive licence) · get_code("1db978be2886dc6a")
How it ran

no invocation recorded.

vgg16_backbone Not yet run
unverified (harvested, no recorded run)
serbanstan/mas3-continual/deeplabv3.py
code served (permissive licence) · get_code("e5659ffc183ebcf6")
How it ran

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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 13 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.

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

Repositories linked to this paper

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

Abstract

We develop an algorithm for adapting a semantic segmentation model that is trained using a labeled source domain to generalize well in an unlabeled target domain. A similar problem has been studied extensively in the unsupervised domain adaptation (UDA) literature, but existing UDA algorithms require access to both the source domain labeled data and the target domain unlabeled data for training a domain agnostic semantic segmentation model. Relaxing this constraint enables a user to adapt pretrained models to generalize in a target domain, without requiring access to source data. To this end, we learn a prototypical distribution for the source domain in an intermediate embedding space. This distribution encodes the abstract knowledge that is learned from the source domain. We then use this distribution for aligning the target domain distribution with the source domain distribution in the embedding space. We provide theoretical analysis and explain conditions under which our algorithm is effective. Experiments on benchmark adaptation task demonstrate our method achieves competitive performance even compared with joint UDA approaches.

For agents

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

get_harvested_code_for_paper("2009.12518")
get_code_for_paper("2009.12518")
have("2009.12518")

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

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

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

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

Connect an agent — have() is free.