SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.12020 · 2022

Domain-invariant Feature Exploration for Domain Generalization

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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 3 have no contract verdict; 0 failures of our instrument; 2 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/2207.12020.json · badge: /api/ran/2207.12020.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
jindongwang/transferlearning canonical (classifier label)
classifier basis not recorded on the link
4 ran · 2 no recorded run
FunctionStatusWhere it lives
BNM Ran
ran on a synthesized input
jindongwang/transferlearning/code/DeepDA/loss_funcs/bnm.py
code served (permissive licence) · get_code("89577066129d8f8e")
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)

# BNM takes two parameters: src and tar
# Looking at the function body:
# - src is not used in the function
# - tar is used with torch.svd(), which expects a 2D or higher tensor
# - The function computes SVD and takes mean of singular values
# - For a batch of outputs, tar should be a 2D tensor (batch_size, num_classes)

# Create dummy tensors
batch_size = 2
num_features = 4

# src: not used, but required parameter - can be any tensor
src = torch.randn(batch_size, num_features)

# tar: softmax target output - 2D tensor (batch, features/classes)
# After SVD, we get singular values which are summed and meaned
tar = torch.randn(batch_size, num_features)

ARGS = {
    "src": src,
    "tar": tar,
}
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_data_loader Ran
ran on a synthesized input
jindongwang/transferlearning/code/DeepDA/data_loader.py
code served (permissive licence) · get_code("587f232d5836a1ba")
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

torch.manual_seed(0)

# Create a simple dataset
class SimpleDataset(torch.utils.data.Dataset):
    def __init__(self, size=10, feature_dim=4):
        self.size = size
        self.feature_dim = feature_dim
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        x = torch.randn(self.feature_dim)
        y = torch.tensor(idx % 2, dtype=torch.long)
        return x, y

# Create dataset instance
dataset = SimpleDataset(size=10, feature_dim=4)

ARGS = {
    "dataset": dataset,
    "batch_size": 2,
    "shuffle": True,
    "drop_last": False,
    "num_workers": 0,
    "infinite_data_loader": False,
}
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 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
load_data Ran
ran on a synthesized input
jindongwang/transferlearning/code/DeepDA/data_loader.py
code served (permissive licence) · get_code("504b2576413d3e07")
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
import torch.nn as nn
from torchvision import datasets, transforms
import tempfile
import os
from PIL import Image
import numpy as np

torch.manual_seed(0)

# Create a minimal temporary image dataset
temp_dir = tempfile.mkdtemp()
class_dir_1 = os.path.join(temp_dir, 'class_1')
class_dir_2 = os.path.join(temp_dir, 'class_2')
os.makedirs(class_dir_1, exist_ok=True)
os.makedirs(class_dir_2, exist_ok=True)

# Create small dummy images
for i in range(2):
    img_array = np.random.randint(0, 255, (64, 64, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(class_dir_1, f'img_{i}.jpg'))
    
for i in range(2):
    img_array = np.random.randint(0, 255, (64, 64, 3), dtype=np.uint8)
    img = Image.fromarray(img_array)
    img.save(os.path.join(class_dir_2, f'img_{i}.jpg'))

ARGS = {
    'data_folder': temp_dir,
    'batch_size': 2,
    'train': True,
    'num_workers': 0,
}
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 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
str2bool Ran
ran, violated the contract we drafted
jindongwang/transferlearning/code/DeepDA/utils.py
code served (permissive licence) · get_code("1c31f800b71774a1")
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 bool, 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

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise ValueError('Boolean value expected.')

ARGS = {
    'v': 'true'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
CORAL Not yet run
unverified (harvested, no recorded run)
jindongwang/transferlearning/code/DeepDA/loss_funcs/coral.py
code served (permissive licence) · get_code("0a0126c7e10b7de1")
How it ran

no invocation recorded.

get_backbone Not yet run
unverified (harvested, no recorded run)
jindongwang/transferlearning/code/DeepDA/backbones.py
code served (permissive licence) · get_code("46b83ab54c34fbc1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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, 1 later) and 3 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
str2bool 5 other papers
2 dated earlier, 3 later
2010.16262 (2020-10)
Experimental design for MRI by greedy policy search
2201.06648 (2022-01)
OmniPrint: A Configurable Printed Character Synthesizer
2305.02164 (2023-05)
Nonparametric Generative Modeling with Conditional Sliced-Wasserstein Flows
and 2 more not named here
CORAL 1 other paper
1 dated earlier
2201.06648 (2022-01)
OmniPrint: A Configurable Printed Character Synthesizer
get_backbone 1 other paper
1 dated earlier
2201.06648 (2022-01)
OmniPrint: A Configurable Printed Character Synthesizer

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

Deep learning has achieved great success in the past few years. However, the performance of deep learning is likely to impede in face of non-IID situations. Domain generalization (DG) enables a model to generalize to an unseen test distribution, i.e., to learn domain-invariant representations. In this paper, we argue that domain-invariant features should be originating from both internal and mutual sides. Internal invariance means that the features can be learned with a single domain and the features capture intrinsic semantics of data, i.e., the property within a domain, which is agnostic to other domains. Mutual invariance means that the features can be learned with multiple domains (cross-domain) and the features contain common information, i.e., the transferable features w.r.t. other domains. We then propose DIFEX for Domain-Invariant Feature EXploration. DIFEX employs a knowledge distillation framework to capture the high-level Fourier phase as the internally-invariant features and learn cross-domain correlation alignment as the mutually-invariant features. We further design an exploration loss to increase the feature diversity for better generalization. Extensive experiments on both time-series and visual benchmarks demonstrate that the proposed DIFEX achieves state-of-the-art performance.

For agents

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

get_harvested_code_for_paper("2207.12020")
get_code_for_paper("2207.12020")
have("2207.12020")

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

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

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

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

Connect an agent — have() is free.