SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.17653 · 2026

LFM: Leveraging Foundation Models for Source-Free Universal Domain Adaptation

Qinghua Hu, Jing Li, Pan Liu, Meng Zhao, Fan Shi, Xu Cheng, Jianhua Zhang, Shengyong Chen, Wanli Xue, Yanhong Yang

arXiv · PDF · Open in the Atlas

Code that ran

19 of 30 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 16 failures of our instrument; 11 no recorded run), measured 2026-11-23; 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/2607.17653.json · badge: /api/ran/2607.17653.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
iamjingli/LFM community
Papers with Code archive
15 ran · 11 no recorded run
copy not recorded community
not in the paper's declared repositories
4 ran · 0 no recorded run
FunctionStatusWhere it lives
Classifier Ran
ran on a synthesized input · constructed an object; no result was computed
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("590aa0969d97b025")
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, Classifier: 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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'embed_dim': 64,
    'class_num': 10,
    'type': 'linear'
}
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 Classifier — 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 Classifier 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
Embedding Ran
ran on a synthesized input · constructed an object; no result was computed
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("85470d3ab6c52602")
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, Embedding: 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
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'feature_dim': 128,
    'embed_dim': 256,
    'type': 'bn'
}
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 Embedding — 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 Embedding 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
Entropy Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from albert0147/aad_sfda
pointer only; the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("94b5622f0aa7add1")
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. A run is recorded.

SFUniDADataset Ran
ran on a synthesized input · constructed an object; no result was computed
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("db868eb88f5a2b9b")
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, SFUniDADataset: 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
import numpy as np
from PIL import Image
import io

# Create a minimal args class
class Args:
    def __init__(self):
        self.dataset = 'Office'
        self.shared_class_num = 10
        self.source_private_class_num = 3
        self.target_private_class_num = 2
        self.target_label_type = 'OSDA'

# Create a minimal RGB image as bytes
def create_dummy_image():
    img = Image.new('RGB', (256, 256), color=(73, 109, 137))
    return img

# Create dummy data_list content
data_list_content = [
    "image1.jpg 0",
    "image2.jpg 1",
    "image3.jpg 10",
    "image4.jpg 13",
    "image5.jpg 15",
]

# Create args
args = Args()

# Create data_dir (we won't actually use files, but the path needs to exist conceptually)
data_dir = "/tmp/dummy_data"

# Parse data_list
data_list = data_list_content

# Create d_type
d_type = "source"

# Create preload_flg
preload_flg = False

ARGS = {
    "args": args,
    "data_dir": data_dir,
    "data_list": data_list,
    "d_type": d_type,
    "preload_flg": preload_flg,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SFUniDADataset — the run constructed an instance of its own class and did not call it; no shape 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
compute_h_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("57ee79329c2933a6")
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 numpy as np

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_classes = 4

# Prediction probabilities (batch_size x num_classes)
# Values should be valid probabilities (sum to 1)
pred_cls_all = torch.tensor([
    [0.7, 0.1, 0.1, 0.1],
    [0.1, 0.8, 0.05, 0.05]
], dtype=torch.float32)

# Ground truth labels
gt_label_all = torch.tensor([0, 1], dtype=torch.long)

# Class list - should contain labels that match gt_label_all
class_list = [0, 1, 2, 3]

# Optional uncertainty predictions (can be None, in which case Entropy will compute it)
pred_unc_all = None

# Simple args dict (can be empty or contain minimal config)
class Args:
    pass

args = Args()

ARGS = {
    "args": args,
    "class_list": class_list,
    "gt_label_all": gt_label_all,
    "pred_cls_all": pred_cls_all,
    "open_flag": True,
    "open_thresh": 0.5,
    "pred_unc_all": pred_unc_all
}
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 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
get_ood_scores_clip Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("51eb44363c6c9cea")
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. 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
from unittest.mock import MagicMock
import numpy as np

torch.manual_seed(0)

class MockCLIPModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.text_projection = nn.Linear(4, 4)
        self.visual_projection = nn.Linear(4, 4)
    
    def get_text_features(self, input_ids, attention_mask):
        # Return dummy text features (batch_size, 4)
        batch_size = input_ids.shape[0]
        return torch.randn(batch_size, 4)
    
    def get_image_features(self, pixel_values):
        # Return dummy image features (batch_size, 4)
        batch_size = pixel_values.shape[0]
        return torch.randn(batch_size, 4)

class MockTokenizer:
    def __call__(self, texts, padding=True, return_tensors='pt'):
        max_len = max(len(t.split()) for t in texts) + 2
        batch_size = len(texts)
        return {
            'input_ids': torch.randint(0, 1000, (batch_size, max_len)),
            'attention_mask': torch.ones(batch_size, max_len)
        }

class MockArgs:
    def __init__(self):
        self.test_labels = ['cat', 'dog', 'bird']
        self.ckpt = 'openai/clip-vit-base-patch32'
        self.t = 0.1
        self.beta = 0.5

# Mock the CLIPTokenizer.from_pretrained to return our mock tokenizer
import transformers
original_from_pretrained = transformers.CLIPTokenizer.from_pretrained
transformers.CLIPTokenizer.from_pretrained = MagicMock(return_value=MockTokenizer())

# Create data loader: list of tuples (label, images, unused1, unused2)
loader = [
    (torch.tensor([0]), torch.randn(2, 3, 32, 32), torch.tensor([1]), torch.tensor([2])),
    (torch.tensor([1]), torch.randn(2, 3, 32, 32), torch.tensor([3]), torch.tensor([4])),
]

# Create mock network
net = MockCLIPModel()

# Create args
args = MockArgs()

# GPT labels with some overlap and some unique ones
gpt_labels = ['fluffy cat', 'golden dog', 'elephant', 'mouse', 'tree', 'car']

ARGS = {
    'args': args,
    'net': net,
    'loader': loader,
    'gpt_labels': gpt_labels,
    'softmax': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, tqdm, transformers — 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
get_pseudo_labels Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("beb9eadd0bfb2292")
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 int; no output shape is stated. 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 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
from torch.utils.data import DataLoader, TensorDataset

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class MinimalModel(nn.Module):
    def __init__(self, feat_dim=4, num_classes=5):
        super().__init__()
        self.feat_dim = feat_dim
        self.num_classes = num_classes
        self.fc = nn.Linear(3, feat_dim)
        self.classifier = nn.Linear(feat_dim, num_classes)
    
    def forward(self, x, apply_softmax=False):
        embed_feat = self.fc(x)
        logits = self.classifier(embed_feat)
        if apply_softmax:
            pred_cls = torch.softmax(logits, dim=1)
        else:
            pred_cls = logits
        return embed_feat, pred_cls

# Create model
model = MinimalModel(feat_dim=4, num_classes=5)

# Create test dataloader
num_samples = 10
img_data = torch.randn(num_samples, 3)
img_labels = torch.randint(0, 5, (num_samples,))
dataset = TensorDataset(torch.arange(num_samples), img_data, img_labels, torch.zeros(num_samples))
test_dataloader = DataLoader(dataset, batch_size=2)

# Create indices
k_idx = torch.tensor([0, 1, 2, 3, 4, 5, 6, 7])  # known indices
unk_idx = torch.tensor([8, 9])  # unknown indices

# Create clip_label (3 different label sets)
clip_label = [
    torch.randint(0, 5, (num_samples,)),  # clip_label[0] - pseudo labels
    torch.randint(0, 5, (num_samples,)),  # clip_label[1] - tw labels
    torch.randint(0, 5, (num_samples,))   # clip_label[2] - tr labels
]

# Create clip_max_s (max scores per sample)
clip_max_s = torch.rand(num_samples)

# Create args config
class Args:
    def __init__(self):
        self.batch_size = 3
        self.nbr = 2

args = Args()

ARGS = {
    'model': model,
    'test_dataloader': test_dataloader,
    'k_idx': k_idx,
    'unk_idx': unk_idx,
    'clip_label': clip_label,
    'args': args,
    'clip_max_s': clip_max_s
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — 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 int — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
load_json Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("1069918b276d2855")
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 dict. 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 json
import tempfile
import os

# Create a temporary JSON file for testing
temp_dir = tempfile.mkdtemp()
test_json_path = os.path.join(temp_dir, 'test_data')

# Write test data to the JSON file
test_data = {
    'key1': 'value1',
    'key2': [1, 2, 3],
    'key3': {'nested': 'object'}
}

with open(test_json_path + '.json', 'w') as fp:
    json.dump(test_data, fp)

ARGS = {
    'filename': test_json_path
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
log_args Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("a7928c7cf111366a")
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 str. 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 sys
from argparse import Namespace

# Create a mock args object with __dict__ attribute
args = Namespace(
    model_name='bert-base',
    learning_rate=0.001,
    batch_size=32,
    epochs=10,
    dropout=0.1,
    hidden_size=768,
    num_layers=12,
    use_cuda=False,
    seed=42,
    output_dir='/tmp/output'
)

ARGS = {'args': args}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
lr_scheduler Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from albert0147/aad_sfda
pointer only; the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("0b7ffc9f8b77529c")
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. A run is recorded.

obtain_gpt_class_and_save Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("e21790f387e86204")
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 coroutine. 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 asyncio
from unittest.mock import Mock, patch, AsyncMock

# Create mock args object with all required attributes
class Args:
    def __init__(self):
        self.url = "http://localhost:8000"
        self.api_key = "test-api-key"
        self.llm_model = "gpt-3.5-turbo"
        self.L = 100
        self.class_num = 4

# Mock the OpenAI client and HTTP responses
def mock_get_completion(args, prompts):
    return "- black stone\n- mountain\n- Ginkgo Tree\n- river\n- Rapeseed"

def mock_get_completion_from_messages(args, context, new_prompt):
    generated_text = "- desert sand\n- ocean wave\n- forest canopy\n- urban skyline\n- rural farmland"
    context.append({'role': 'user', 'content': new_prompt})
    context.append({'role': 'assistant', 'content': generated_text})
    return (generated_text, context)

ARGS = {
    'args': Args(),
    'file_path': '/tmp/test_classes.json',
    'class_list': "['Husky dog', 'Garfield cat', 'churches', 'truck']"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine 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
op_copy Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from albert0147/aad_sfda
pointer only; the stored copy get_code serves, from albert0147/aad_sfda, is pointer only (licence: NONE) · get_code("93a11f62e4a129f0")
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. A run is recorded.

pre_filter Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("d9512c44141b4aa8")
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. 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

torch.manual_seed(0)

# Build a minimal tokenizer stand-in that implements the required interface
class MinimalTokenizer:
    def __call__(self, texts, padding=True, return_tensors='pt'):
        # Return minimal tokenizer output with input_ids and attention_mask
        batch_size = len(texts)
        max_len = 8
        input_ids = torch.randint(0, 1000, (batch_size, max_len))
        attention_mask = torch.ones((batch_size, max_len))
        return {
            'input_ids': input_ids,
            'attention_mask': attention_mask
        }

# Build a minimal net that implements get_text_features
class MinimalCLIPNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.text_proj = nn.Linear(512, 256)
    
    def get_text_features(self, input_ids, attention_mask):
        # Return text features of shape (batch_size, 256)
        batch_size = input_ids.shape[0]
        # Create dummy features
        features = torch.randn(batch_size, 256)
        return features

# Create instances
net = MinimalCLIPNet()
tokenizer = MinimalTokenizer()
test_labels = ['dog', 'cat']
gpt_labels = ['puppy', 'kitten', 'bird']

ARGS = {
    'net': net,
    'tokenizer': tokenizer,
    'test_labels': test_labels,
    'gpt_labels': gpt_labels
}
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
remove_overlap_class Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("f32a4c158be3016c")
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 list, 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
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - test_labels: iterable of phrases (strings), each phrase is split by spaces
# - gpt_labels: iterable of phrases (strings), each phrase is split by spaces
# - The function extracts all words from test_labels, then filters gpt_labels
#   to remove any phrases containing those words

test_labels = [
    "hello world",
    "foo bar baz",
    "quick brown fox"
]

gpt_labels = [
    "hello there",
    "something else",
    "quick red fox",
    "unknown words",
    "bar code"
]

ARGS = {
    "test_labels": test_labels,
    "gpt_labels": gpt_labels
}
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 list, ndim 1, dtype family float — a list 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
set_logger Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("4c7a1e20b84ac632")
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 Logger. 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 os
import sys
import tempfile
from argparse import Namespace

# Create a temporary directory for logging
temp_dir = tempfile.mkdtemp()

# Create args object with all required attributes
args = Namespace(
    test=False,
    save_dir=temp_dir
)

ARGS = {
    'args': args,
    'log_name': 'train_log.txt'
}
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 Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
stringtolist Ran
ran; our contract draft was wrong, not the code
this paper's copy was not recorded; identical code first harvested from tmlr-group/eoe
pointer only; the stored copy get_code serves, from tmlr-group/eoe, is pointer only (licence: NONE) · get_code("46062947cf3ab0e6")
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. A run is recorded.

test Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("fe73cf9445756920")
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. 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 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
import numpy as np

torch.manual_seed(0)

# Build a minimal model that matches the expected interface
class MinimalModel(nn.Module):
    def __init__(self, num_classes=4):
        super().__init__()
        self.linear = nn.Linear(3, num_classes)
    
    def forward(self, x, apply_softmax=False):
        # Returns (feature, pred_cls)
        features = self.linear(x)
        if apply_softmax:
            pred_cls = torch.softmax(features, dim=1)
        else:
            pred_cls = features
        return features, pred_cls

# Build a minimal dataloader
# Each item is (_, imgs_test, imgs_label, _)
dataloader = []
for batch_idx in range(2):
    imgs_test = torch.randn(2, 3)  # batch_size=2, feature_dim=3
    imgs_label = torch.tensor([0, 1])  # batch_size=2, label values
    dataloader.append((None, imgs_test, imgs_label, None))

# Build args config
class Args:
    def __init__(self):
        self.source_class_list = [0, 1, 2]
        self.target_class_list = [0, 1]
        self.target_private_class_num = 1
        self.w_0 = 0.5

args = Args()
model = MinimalModel(num_classes=4)

ARGS = {
    'args': args,
    'model': model,
    'dataloader': dataloader,
    'src_flg': False
}
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 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
test_transform Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("13b7b1c692c187e0")
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 Compose. 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 numpy as np
from torchvision import transforms
from PIL import Image

torch.manual_seed(0)

# Create a small dummy image for testing the transform
dummy_image = Image.new('RGB', (300, 300), color=(73, 109, 137))

ARGS = {
    'resize_size': 256,
    'crop_size': 224
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
train_transform Ran
ran; our contract draft was wrong, not the code
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("ada9656c14c75934")
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 Compose. 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 numpy as np
from torchvision import transforms

torch.manual_seed(0)

# The train_transform function takes two optional parameters:
# - resize_size: int, used in transforms.Resize
# - crop_size: int, used in transforms.RandomCrop
# Both have default values, so we need to provide explicit values for ARGS

ARGS = {
    "resize_size": 256,
    "crop_size": 224,
}
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 Compose — a Compose output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Compose 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
PromptGenerator Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("4db77fc0e9bf39b0")
How it ran

no invocation recorded.

ResBase Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("380df4780014a94c")
How it ran

no invocation recorded.

SFUniDA Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("6153fbffb3985887")
How it ran

no invocation recorded.

VGGBase Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("112349e40ab69ddb")
How it ran

no invocation recorded.

get_completion Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("4528e48fcffa0b3d")
How it ran

no invocation recorded.

get_completion_from_messages Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("dd65b4eaa2bc257e")
How it ran

no invocation recorded.

get_idx Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("780faf558bba6b54")
How it ran

no invocation recorded.

load_llm_classes Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("6bad6d16ba57825e")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("51b1a343a1c5c316")
How it ran

no invocation recorded.

set_model_clip Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("92aa3c44ba29df0c")
How it ran

no invocation recorded.

tr Not yet run
unverified (harvested, no recorded run)
iamjingli/LFM/train_target.py
code served (permissive licence) · get_code("721005b41f811e51")
How it ran

no invocation recorded.

Also present in other papers' code

Of 30 samples lifted from this paper's linked repositories, 30 carry a function identity and 0 do not. Of the 30 distinct functions with an identity, 14 are also present in other papers whose code we hold (14 with at least one paper dated earlier, 0 the same month, 0 later) and 16 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
op_copy
brick of this paper's assembly: helper
21 other papers
21 dated earlier · 5 only as an assembly brick
2002.08546 (2020-02)
Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation
2012.07297 (2020-12)
Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 18 more not named here
lr_scheduler
brick of this paper's assembly: scheduler
18 other papers
18 dated earlier · 3 only as an assembly brick
2002.08546 (2020-02)
Do We Really Need to Access the Source Data? Source Hypothesis Transfer for Unsupervised Domain Adaptation
2012.07297 (2020-12)
Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer
2104.01539 (2021-04)
DINE: Domain Adaptation from Single and Multiple Black-box Predictors
and 15 more not named here
Entropy
brick of this paper's assembly: helper
16 other papers
16 dated earlier · 4 only as an assembly brick
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
2104.01845 (2021-04)
Unsupervised Multi-source Domain Adaptation Without Access to Source Data
and 13 more not named here
stringtolist
brick of this paper's assembly: helper
6 other papers
6 dated earlier
2210.07183 (2022-10)
Visual Classification via Description from Large Language Models
2306.07282 (2023-06)
Waffling around for Performance: Visual Classification with Random Words and Broad Concepts
2404.00419 (2024-04)
Do Vision-Language Models Understand Compound Nouns?
and 3 more not named here
load_json
brick of this paper's assembly: helper
4 other papers
4 dated earlier · 1 only as an assembly brick
2109.01134 (2021-09)
Learning to Prompt for Vision-Language Models
2406.02915 (2024-06)
Visual-Text Cross Alignment: Refining the Similarity Score in Vision-Language Models
2407.14412 (2024-07)
DEAL: Disentangle and Localize Concept-level Explanations for VLMs
and 1 more not named here
Classifier
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2204.02811 (2022-04)
BMD: A General Class-balanced Multicentric Dynamic Prototype Strategy for Source-free Domain Adaptation
2303.07110 (2023-03)
Upcycling Models under Domain and Category Shift
Embedding
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2204.02811 (2022-04)
BMD: A General Class-balanced Multicentric Dynamic Prototype Strategy for Source-free Domain Adaptation
2303.07110 (2023-03)
Upcycling Models under Domain and Category Shift
ResBase
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2204.02811 (2022-04)
BMD: A General Class-balanced Multicentric Dynamic Prototype Strategy for Source-free Domain Adaptation
2303.07110 (2023-03)
Upcycling Models under Domain and Category Shift
VGGBase
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 2 only as an assembly brick
2204.02811 (2022-04)
BMD: A General Class-balanced Multicentric Dynamic Prototype Strategy for Source-free Domain Adaptation
2303.07110 (2023-03)
Upcycling Models under Domain and Category Shift
SFUniDA
brick of this paper's assembly: model
1 other paper
1 dated earlier · 1 only as an assembly brick
2303.07110 (2023-03)
Upcycling Models under Domain and Category Shift
log_args
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2403.03421 (2024-03)
LEAD: Learning Decomposition for Source-free Universal Domain Adaptation
set_logger
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2403.03421 (2024-03)
LEAD: Learning Decomposition for Source-free Universal Domain Adaptation
test_transform
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2403.03421 (2024-03)
LEAD: Learning Decomposition for Source-free Universal Domain Adaptation
train_transform
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2403.03421 (2024-03)
LEAD: Learning Decomposition for Source-free Universal Domain Adaptation

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

Source-free universal domain adaptation (SF-UniDA) adapts a pre-trained source model to an unlabeled target domain under both covariate and label shifts, without access to source data. However, existing SF-UniDA methods rely on inefficient techniques such as threshold tuning and clustering. Foundation models (FMs), known for their generalization and zero-shot capabilities, remain underexplored in SF-UniDA. In this paper, we propose a framework that leverages foundation models (LFM) for SF-UniDA. We use a vision-language model (VLM) to compute similarities between target samples and text labels, including those for unknown classes generated by prompting a large language model. The label shift type is determined by analyzing the coefficient of variation of a similarity-based sample-level score. Unknown samples are identified using a binary Gaussian mixture model fitted to another similaritybased metric. Under a consensus strategy, the pseudo-labels generated by the VLM are refined by the target model initialized with the pre-trained source model, integrating knowledge from both the source domain and foundation models. Finally, these refined pseudo-labels are used to train the target model. Extensive experiments across all possible label shifts and multiple benchmarks demonstrate the effectiveness and superiority of our proposed LFM framework. Our code is available at https://github.com/iamjingli/LFM.

For agents

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

get_harvested_code_for_paper("2607.17653")
get_code_for_paper("2607.17653")
have("2607.17653")

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

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

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

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

Connect an agent — have() is free.