SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.07542 · 2023

Source-Free Domain Adaptation with Temporal Imputation for Time Series Data

arXiv · PDF · Open in the Atlas

Code that ran

9 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, 1 violated it and 0 have no contract verdict; 8 failures of our instrument; 4 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/2307.07542.json · badge: /api/ran/2307.07542.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
mohamedr002/mapu_sfda_ts canonical (classifier label)
classifier basis: census
9 ran · 4 no recorded run
FunctionStatusWhere it lives
EntropyLoss Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/models/loss.py
code served (permissive licence) · get_code("0cb7cfb326eed8be")
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

torch.manual_seed(0)

# The function expects a tensor input_ with:
# - .ge() method (comparison operation)
# - .masked_select() function compatibility
# - torch.log() compatibility
# - .sum() method
# - .size(0) method (batch dimension)
# Create a small probability-like tensor (values between 0 and 1)
# with shape (2, 4) - batch size 2, feature dim 4
input_tensor = torch.rand(2, 4)

ARGS = {
    "input_": input_tensor
}
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
data_generator Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/dataloader/dataloader.py
code served (permissive licence) · get_code("ddb315160fe5428e")
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 DataLoader. 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.utils.data
import os
import tempfile

torch.manual_seed(0)

# Create a minimal config class for dataset_configs
class DatasetConfig:
    def __init__(self):
        self.input_channels = 3
        self.normalize = False
        self.shuffle = True
        self.drop_last = False

# Create sample data and save it to a temporary directory
temp_dir = tempfile.mkdtemp()

# Create train data
train_samples = torch.randn(2, 4, 5)  # 2 samples, 4 features, 5 time steps
train_labels = torch.tensor([0, 1])
train_dataset = {
    'samples': train_samples,
    'labels': train_labels
}
torch.save(train_dataset, os.path.join(temp_dir, 'train_domain_0.pt'))

# Create test data
test_samples = torch.randn(2, 4, 5)
test_labels = torch.tensor([1, 0])
test_dataset = {
    'samples': test_samples,
    'labels': test_labels
}
torch.save(test_dataset, os.path.join(temp_dir, 'test_domain_0.pt'))

# Create hparams dict
hparams = {
    'batch_size': 2
}

ARGS = {
    'data_path': temp_dir,
    'domain_id': 'domain_0',
    'dataset_configs': DatasetConfig(),
    'hparams': hparams,
    'dtype': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
evident_dl Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/models/loss.py
code served (permissive licence) · get_code("c756f609983731ad")
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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small predictions tensor
# Shape: (batch_size=2, num_classes=4)
# The function applies softplus, so we use raw values
predictions = torch.randn(2, 4)

ARGS = {
    "predictions": predictions
}
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 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
evidential_uncertainty Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/models/loss.py
code served (permissive licence) · get_code("1ac854c0fdcc0718")
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 small tensors for the function
batch_size = 2
num_classes = 4

# predictions: raw logits that will be passed through softplus
predictions = torch.randn(batch_size, num_classes, dtype=torch.float32)

# target: class indices for each sample in batch
target = torch.tensor([0, 2], dtype=torch.long)

# num_classes: number of output classes
num_classes_arg = num_classes

# device: where computations happen
device = 'cpu'

ARGS = {
    'predictions': predictions,
    'target': target,
    'num_classes': num_classes_arg,
    'device': device
}
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_iwcv_value Ran
ran, violated the contract we drafted
mohamedr002/mapu_sfda_ts/utils.py
code served (permissive licence) · get_code("e285d60da7bd42cc")
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 float64, ndim 0, 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

# Create small numpy arrays with distinct dimensions
# N=2 samples, d=4 features for weight
weight = np.random.randn(2, 4)

# Same shape for error array
error = np.random.randn(2, 4)

ARGS = {
    'weight': weight,
    'error': error
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
masking Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mohamedr002/mapu_sfda_ts/models/models.py
code served (permissive licence) · get_code("b9a47bf5513b42f9")
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 torch
from einops import rearrange

torch.manual_seed(0)

# Analyze the function:
# - x: tensor that gets rearranged as 'a b (p l) -> a b p l' with p=num_splits
#   This means x.shape should be (a, b, p*l) where p=num_splits
#   After rearrange, patches will be (a, b, p, l)
# - num_splits: int, default 8 - used as p in rearrange
# - num_masked: int, default 4 - number of patches to mask

# For tiny tensors:
# Let's use a=2 (batch), b=3 (another dimension), num_splits=8, so we need p*l = 8*something
# Let's make l=4, so total = 8*4 = 32
# x shape: (2, 3, 32)

x = torch.randn(2, 3, 32)
num_splits = 8
num_masked = 4

ARGS = {
    'x': x,
    'num_splits': num_splits,
    'num_masked': num_masked
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — 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
shuffling Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
mohamedr002/mapu_sfda_ts/models/.ipynb_checkpoints/models-checkpoint.py
code served (permissive licence) · get_code("4949c2b485df5527")
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 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
from einops import rearrange

torch.manual_seed(0)

# The function expects:
# x: a tensor that will be rearranged with einops
# num_splits: int, number of patches to split into
# num_shuffled: int, number of patches to shuffle

# Looking at the function body:
# - x is rearranged as 'a b (p l) -> a b p l' where p=num_splits
# - This means x.shape should be (a, b, p*l) where p=num_splits
# - x.shape[1] is used for looping, so we need at least 1 in dimension 1
# - rand_indices is created from x.shape[1] and num_splits
# - full_indices[:num_shuffled] means num_shuffled must be <= num_splits

# Let's construct a valid x tensor:
# If num_splits = 10 and we want the third dimension to be divisible by num_splits,
# let's say x.shape = (2, 4, 100) where 100 = 10 * 10
# So a=2, b=4, p=10, l=10

a = 2
b = 4
p = 10  # num_splits
l = 10
x = torch.randn(a, b, p * l)

num_splits = 10
num_shuffled = 4

ARGS = {
    "x": x,
    "num_splits": num_splits,
    "num_shuffled": num_shuffled,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 4, 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
starting_logs Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/utils.py
code served (permissive licence) · get_code("7c583e1ae26f9263")
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 os
import sys
import logging
from datetime import datetime
import tempfile

ARGS = {
    "data_type": "MNIST",
    "da_method": "dann",
    "exp_log_dir": tempfile.gettempdir(),
    "src_id": "source_domain",
    "tgt_id": "target_domain",
    "run_id": 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
to_device Ran
ran; our contract draft was wrong, not the code
mohamedr002/mapu_sfda_ts/utils.py
code served (permissive licence) · get_code("d15e9940dc518fd2")
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
import collections

torch.manual_seed(0)

# Test case 1: tensor input
tensor_input = torch.randn(2, 4)
device_cpu = torch.device('cpu')

# Test case 2: string input
string_input = "hello"

# Test case 3: dict mapping with tensors
dict_input = {
    'tensor1': torch.randn(2, 4),
    'tensor2': torch.randn(3, 5),
    'string_key': "test"
}

# Test case 4: list/sequence with tensors
list_input = [torch.randn(2, 4), torch.randn(3, 5), "string_in_list"]

# Test case 5: nested structure (dict containing list and tensors)
nested_input = {
    'tensors': [torch.randn(2, 4), torch.randn(3, 5)],
    'single_tensor': torch.randn(4, 6),
    'metadata': "info"
}

# We'll test with a simple tensor and CPU device as the primary case
ARGS = {
    'input': tensor_input,
    'device': device_cpu
}
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
get_algorithm_class Not yet run
unverified (harvested, no recorded run)
mohamedr002/mapu_sfda_ts/algorithms/algorithms.py
code served (permissive licence) · get_code("b0bc80b1655a6802")
How it ran

no invocation recorded.

get_backbone_class Not yet run
unverified (harvested, no recorded run)
mohamedr002/mapu_sfda_ts/models/models.py
code served (permissive licence) · get_code("f8ac075efb28ded9")
How it ran

no invocation recorded.

get_dataset_class Not yet run
unverified (harvested, no recorded run)
mohamedr002/mapu_sfda_ts/configs/data_model_configs.py
code served (permissive licence) · get_code("8dadd34c7426858e")
How it ran

no invocation recorded.

get_hparams_class Not yet run
unverified (harvested, no recorded run)
mohamedr002/mapu_sfda_ts/configs/hparams.py
code served (permissive licence) · get_code("87db44cd0a18316c")
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, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 2 the same month, 2 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
get_algorithm_class 39 other papers
27 dated earlier, 2 the same month, 10 later
1907.02893 (2019-07)
Invariant Risk Minimization
2007.01434 (2020-07)
In Search of Lost Domain Generalization
2007.02931 (2020-07)
Adaptive Risk Minimization: Learning to Adapt to Domain Shift
and 36 more not named here
get_dataset_class 21 other papers
15 dated earlier, 2 the same month, 4 later
1907.02893 (2019-07)
Invariant Risk Minimization
2007.01434 (2020-07)
In Search of Lost Domain Generalization
2106.02266 (2021-06)
SAND-mask: An Enhanced Gradient Masking Strategy for the Discovery of Invariances in Domain Generalization
and 18 more not named here
EntropyLoss 2 other papers
2 dated earlier
2302.03133 (2023-02)
Domain Adaptation for Time Series Under Feature and Label Shifts
2305.01281 (2023-05)
Addressing Parameter Choice Issues in Unsupervised Domain Adaptation by Aggregation
get_backbone_class 2 other papers
2 dated earlier
2302.03133 (2023-02)
Domain Adaptation for Time Series Under Feature and Label Shifts
2305.01281 (2023-05)
Addressing Parameter Choice Issues in Unsupervised Domain Adaptation by Aggregation
get_hparams_class 1 other paper
1 dated earlier
2302.03133 (2023-02)
Domain Adaptation for Time Series Under Feature and Label Shifts
get_iwcv_value 1 other paper
1 dated earlier
2302.03133 (2023-02)
Domain Adaptation for Time Series Under Feature and Label Shifts
starting_logs 1 other paper
1 dated earlier
2302.03133 (2023-02)
Domain Adaptation for Time Series Under Feature and Label Shifts
to_device 1 other paper
1 dated earlier
1907.10915 (2019-07)
Self-supervised Domain Adaptation for Computer Vision Tasks

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 pretrained model from a labeled source domain to an unlabeled target domain without access to the source domain data, preserving source domain privacy. Despite its prevalence in visual applications, SFDA is largely unexplored in time series applications. The existing SFDA methods that are mainly designed for visual applications may fail to handle the temporal dynamics in time series, leading to impaired adaptation performance. To address this challenge, this paper presents a simple yet effective approach for source-free domain adaptation on time series data, namely MAsk and imPUte (MAPU). First, to capture temporal information of the source domain, our method performs random masking on the time series signals while leveraging a novel temporal imputer to recover the original signal from a masked version in the embedding space. Second, in the adaptation step, the imputer network is leveraged to guide the target model to produce target features that are temporally consistent with the source features. To this end, our MAPU can explicitly account for temporal dependency during the adaptation while avoiding the imputation in the noisy input space. Our method is the first to handle temporal consistency in SFDA for time series data and can be seamlessly equipped with other existing SFDA methods. Extensive experiments conducted on three real-world time series datasets demonstrate that our MAPU achieves significant performance gain over existing methods. Our code is available at \url{https://github.com/mohamedr002/MAPU_SFDA_TS}.

For agents

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

get_harvested_code_for_paper("2307.07542")
get_code_for_paper("2307.07542")
have("2307.07542")

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

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

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

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

Connect an agent — have() is free.