SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.12815 · 2020

Efficient Domain Generalization via Common-Specific Low-Rank Decomposition

arXiv · PDF · Open in the Atlas

Code that ran

4 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 4 have no contract verdict; 0 failures of our instrument; 7 no recorded run), measured 2026-11-21; 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/2003.12815.json · badge: /api/ran/2003.12815.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
vihari/csd canonical (classifier label)
classifier basis: census
4 ran · 7 no recorded run
FunctionStatusWhere it lives
alexnet Ran
ran on a synthesized input
vihari/csd/pacs/models/alexnet.py
code served (permissive licence) · get_code("81b32462156333ce")
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 AlexNet. 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)

# The function signature is: alexnet(classes, pretrained=False)
# - classes: int, number of output classes
# - pretrained: bool, whether to load pretrained weights

ARGS = {
    'classes': 10,
    'pretrained': 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 AlexNet — a AlexNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AlexNet 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
custom_rot Ran
ran on a synthesized input
vihari/csd/rotation/ResNet.py
code served (permissive licence) · get_code("639603695957f436")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
from scipy.ndimage import rotate as rot

torch = None  # not needed for this function

def custom_rot(img, angle, reshape=False):
    _rot = rot(img, angle, reshape=reshape)
    mx, mn = (1, 0)
    return (_rot - mn) / (mx - mn)

# Create a small test image (2D numpy array)
img = np.random.rand(4, 3).astype(np.float32)

# Define angle in degrees
angle = 45

ARGS = {
    "img": img,
    "angle": angle,
    "reshape": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
one_hot Ran
ran on a synthesized input
vihari/csd/pacs/train_csd.py
code served (permissive licence) · get_code("ded0bf1e1b21f399")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (4, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function:
# - ids: used with len(ids) and as indices in np.arange(len(ids)), ids
#   Should be a 1D array of integers
# - depth: used to create zeros array [len(ids), depth]
#   Should be an integer

# Create small, valid arguments
ids = np.array([0, 2, 1, 3])  # 4 class indices
depth = 5  # number of classes (distinct from len(ids) for probing)

ARGS = {
    'ids': ids,
    'depth': depth
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (4, 5) — shape (4, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rankL Ran
ran on a synthesized input
vihari/csd/speech/losses.py
code served (permissive licence) · get_code("a3dee273f5549710")
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 float32, 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 numpy as np

def rankL(np_rank):
    r = int(np_rank[-1])
    _l = 0
    for k in range(1, r + 1):
        _l += 1.0 / k
    return np.float32(_l)

# Construct valid arguments
# np_rank should be a numpy array where the last element is an integer
# representing the rank value

np_rank_value = np.array([1, 2, 3, 4, 5])

ARGS = {
    "np_rank": np_rank_value
}
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 float32, 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
load_data Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/lipitk.py
code served (permissive licence) · get_code("7867292780cc60d7")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/nhcd.py
code served (permissive licence) · get_code("ff5baf06d230e98a")
How it ran

no invocation recorded.

prepare_data Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/lipitk.py
code served (permissive licence) · get_code("317da15047e473d1")
How it ran

no invocation recorded.

prepare_data Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/rmnist.py
code served (permissive licence) · get_code("a8669f97e275a295")
How it ran

no invocation recorded.

prepare_data_for Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/rmnist.py
code served (permissive licence) · get_code("6ab3b3ea2d111f68")
How it ran

no invocation recorded.

training Not yet run
unverified (harvested, no recorded run)
vihari/csd/hw/nhcd.py
code served (permissive licence) · get_code("59c9109a03787bbe")
How it ran

no invocation recorded.

warp_loss Not yet run
unverified (harvested, no recorded run)
vihari/csd/speech/losses.py
code served (permissive licence) · get_code("5e2641cdd55e645c")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
alexnet 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-21.

Repositories linked to this paper

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

Abstract

Domain generalization refers to the task of training a model which generalizes to new domains that are not seen during training. We present CSD (Common Specific Decomposition), for this setting,which jointly learns a common component (which generalizes to new domains) and a domain specific component (which overfits on training domains). The domain specific components are discarded after training and only the common component is retained. The algorithm is extremely simple and involves only modifying the final linear classification layer of any given neural network architecture. We present a principled analysis to understand existing approaches, provide identifiability results of CSD,and study effect of low-rank on domain generalization. We show that CSD either matches or beats state of the art approaches for domain generalization based on domain erasure, domain perturbed data augmentation, and meta-learning. Further diagnostics on rotated MNIST, where domains are interpretable, confirm the hypothesis that CSD successfully disentangles common and domain specific components and hence leads to better domain generalization.

For agents

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

get_harvested_code_for_paper("2003.12815")
get_code_for_paper("2003.12815")
have("2003.12815")

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

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

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

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

Connect an agent — have() is free.