SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.07591 · ECCV · 2022

Uncertainty-guided Source-free Domain Adaptation

Elisa Ricci, Nicu Sebe, Arno Solin, Martin Trapp, Juho Kannala, Subhankar Roy, Andrea Pilzer

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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 5 have no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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/2208.07591.json · badge: /api/ran/2208.07591.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
roysubhankar/uncertainty-sfda canonical (classifier label)
classifier basis not recorded on the link
7 ran · 4 no recorded run
FunctionStatusWhere it lives
Entropy Ran
ran on a synthesized input
roysubhankar/uncertainty-sfda/cifar/loss.py
code served (permissive licence) · get_code("f3ce545fc143fc83")
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)

# Create a small probability distribution tensor
# Shape: (batch_size=2, num_classes=4)
# Values should be valid probabilities (sum to 1, all positive)
input_tensor = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

ARGS = {
    'input_': input_tensor,
    'reduction': 'sum'
}
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
Entropy Ran
ran on a synthesized input
roysubhankar/uncertainty-sfda/toy_classification/multiclass_shot.py
code served (permissive licence) · get_code("618b4bb0ee3cb5eb")
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)

# Create a small probability distribution tensor
# Shape: (2, 4) - batch size 2, 4 probability values
# Values should be valid probabilities (sum to 1, in [0,1])
input_tensor = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

ARGS = {
    'input_': input_tensor,
    'reduction': 'sum'
}
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
calc_acc Ran
ran on a synthesized input
roysubhankar/uncertainty-sfda/cifar/main_cda.py
code served (permissive licence) · get_code("8eed95a2fb35fc66")
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 float, 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 torch
import torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

class Args:
    def __init__(self):
        self.gpu = 0

# Create a simple model
model = SimpleModel(num_classes=3)

# Create a simple validation loader (list of tuples with 3 elements each)
# Each tuple contains: (images, labels, something_else)
val_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1]), torch.tensor([0, 0])),
    (torch.randn(2, 4), torch.tensor([2, 0]), torch.tensor([1, 1])),
]

# Create args object
args = Args()

ARGS = {
    'args': args,
    'val_loader': val_loader,
    'model': model,
}
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 float, 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
denorm Ran
ran; our contract draft was wrong, not the code
roysubhankar/uncertainty-sfda/cifar/data_list.py
code served (permissive licence) · get_code("6e16337c88174e00")
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 2, dtype family float, shape (2, 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 torch

torch.manual_seed(0)

# The function denorm takes a tensor x, applies (x + 1) / 2, and clamps to [0, 1]
# We need to provide a tensor that works with these operations

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 2, dtype family float, 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
grl_hook Ran
ran; our contract draft was wrong, not the code
roysubhankar/uncertainty-sfda/cifar/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.

prepare_transform Ran
ran on a synthesized input
roysubhankar/uncertainty-sfda/cifar/data_list.py
code served (permissive licence) · get_code("914593a4ff59e6f3")
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 torch
from torchvision import transforms as transform_lib

torch.manual_seed(0)

ARGS = {
    'dataset': 'CIFAR9'
}
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 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
source_train Ran
ran on a synthesized input
roysubhankar/uncertainty-sfda/toy_classification/multiclass_shot.py
code served (permissive licence) · get_code("c5ed9b407bcf6e76")
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 SimpleModel. 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
import numpy as np

torch.manual_seed(0)

# Create a simple model
class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Create small tensors
batch_size = 2
input_dim = 4
num_classes = 3

X = np.random.randn(batch_size, input_dim).astype(np.float32)
Y = np.random.randint(0, num_classes, batch_size).astype(np.int64)

model = SimpleModel(input_dim, num_classes)
opt = optim.SGD(model.parameters(), lr=0.01)

ARGS = {
    'X': X,
    'Y': Y,
    'model': model,
    'opt': opt
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
CDAN Not yet run
unverified (harvested, no recorded run)
roysubhankar/uncertainty-sfda/cifar/loss.py
pointer only (licence: MIT); the stored copy get_code serves, from thuml/CDAN, is pointer only (licence: NONE) · get_code("385d1e010dfb76a9")
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 thuml/CDAN, 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.

estimate_variance Not yet run
unverified (harvested, no recorded run)
roysubhankar/uncertainty-sfda/cifar/laplace.py
code served (permissive licence) · get_code("42c61c7f8959ae74")
How it ran

no invocation recorded.

shift_data Not yet run
unverified (harvested, no recorded run)
roysubhankar/uncertainty-sfda/toy_classification/multiclass_shot.py
code served (permissive licence) · get_code("3d1f1abcfc6f520c")
How it ran

no invocation recorded.

trainval_loader Not yet run
unverified (harvested, no recorded run)
roysubhankar/uncertainty-sfda/cifar/data_list.py
code served (permissive licence) · get_code("d09792f112e6ca1e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 later) and 8 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
grl_hook 12 other papers
9 dated earlier, 3 later · 3 only as an assembly brick
1505.07818 (2015-05)
Domain-Adversarial Training of Neural Networks
2003.02541 (2020-03)
A Balanced and Uncertainty-aware Approach for Partial Domain Adaptation
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
and 9 more not named here
denorm 5 other papers
4 dated earlier, 1 later
1805.08318 (2018-05)
Self-Attention Generative Adversarial Networks
1809.11096 (2018-09)
Large Scale GAN Training for High Fidelity Natural Image Synthesis
2010.02637 (2020-10)
Weakly Supervised Disentangled Generative Causal Representation Learning
and 2 more not named here
CDAN 4 other papers
3 dated earlier, 1 later
2007.14612 (2020-07)
Clarinet: A One-step Approach Towards Budget-friendly Unsupervised Domain Adaptation
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
2107.12585 (2021-07)
Nearest Neighborhood-Based Deep Clustering for Source Data-absent Unsupervised Domain Adaptation
and 1 more not named here

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

Source-free domain adaptation (SFDA) aims to adapt a classifier to an unlabelled target data set by only using a pre-trained source model. However, the absence of the source data and the domain shift makes the predictions on the target data unreliable. We propose quantifying the uncertainty in the source model predictions and utilizing it to guide the target adaptation. For this, we construct a probabilistic source model by incorporating priors on the network parameters inducing a distribution over the model predictions. Uncertainties are estimated by employing a Laplace approximation and incorporated to identify target data points that do not lie in the source manifold and to down-weight them when maximizing the mutual information on the target data. Unlike recent works, our probabilistic treatment is computationally lightweight, decouples source training and target adaptation, and requires no specialized source training or changes of the model architecture. We show the advantages of uncertainty-guided SFDA over traditional SFDA in the closed-set and open-set settings and provide empirical evidence that our approach is more robust to strong domain shifts even without tuning.

For agents

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

get_harvested_code_for_paper("2208.07591")
get_code_for_paper("2208.07591")
have("2208.07591")

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

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

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

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

Connect an agent — have() is free.