SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.09410 · NeurIPS · 2021

Exploiting Domain-Specific Features to Enhance Domain Generalization

Dinh Phung, Toan Tran, Anh Tran, Manh-Ha Bui

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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; 1 failure of our instrument; 1 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/2110.09410.json · badge: /api/ran/2110.09410.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
vinairesearch/mdsdi alias (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
Domain_Discriminator Ran
ran on a synthesized input · constructed an object; no result was computed
vinairesearch/mdsdi/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("5e4bc9e4b4b65626")
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, Domain_Discriminator: 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)

# Based on the Domain_Discriminator.__init__ signature:
# - feature_dim: integer dimension for features
# - domain_classes: integer number of domain classes

ARGS = {
    'feature_dim': 8,
    'domain_classes': 3
}
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 Domain_Discriminator — 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 Domain_Discriminator 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
GradReverse Ran
ran on a synthesized input · constructed an object; no result was computed
vinairesearch/mdsdi/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("ebff29d9d1f6869c")
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, GradReverse: 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

torch.manual_seed(0)

# GradReverse.forward takes ctx and x
# x is used with x.view_as(x), so it needs to be a tensor
# GradReverse.backward takes ctx and grad_output
# grad_output is negated and returned

# Create a small tensor for testing
x = torch.randn(2, 4, requires_grad=True)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type GradReverse — 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 GradReverse 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
ZS_Domain_Classifier Ran
ran on a synthesized input · constructed an object; no result was computed
vinairesearch/mdsdi/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("89eab76de8db596a")
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, ZS_Domain_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)

# The ZS_Domain_Classifier.__init__ takes:
# - feature_dim: int, dimension of input features
# - domain_classes: int, number of domain classes for classification

ARGS = {
    "feature_dim": 4,
    "domain_classes": 3,
}
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 ZS_Domain_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 ZS_Domain_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
random_pairs_of_minibatches Ran
ran; our contract draft was wrong, not the code
vinairesearch/mdsdi/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("4fa2b54178fcc1df")
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. 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)

# Create small minibatches as list of (x, y) tuples
# Each minibatch is ((features_tensor, labels_tensor))
minibatch_1 = (torch.randn(2, 4), torch.randint(0, 2, (2,)))
minibatch_2 = (torch.randn(3, 4), torch.randint(0, 2, (3,)))
minibatch_3 = (torch.randn(2, 4), torch.randint(0, 2, (2,)))

minibatches = [minibatch_1, minibatch_2, minibatch_3]

ARGS = {
    "minibatches": minibatches
}
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 list — a list 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
MDSDI Not yet run
unverified (harvested, no recorded run)
vinairesearch/mdsdi/DomainBed/domainbed/algorithms.py
code served (permissive licence) · get_code("6a8adc1a94a86cbf")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 4 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
random_pairs_of_minibatches
brick of this paper's assembly: helper
7 other papers
7 later
2203.10789 (2022-03)
Domain Generalization by Mutual-Information Regularization with Pre-trained Models
2302.14685 (2023-02)
DART: Diversify-Aggregate-Repeat Training Improves Generalization of Neural Networks
2303.01233 (2023-03)
Domain-aware Triplet loss in Domain Generalization
and 4 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-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

Domain Generalization (DG) aims to train a model, from multiple observed source domains, in order to perform well on unseen target domains. To obtain the generalization capability, prior DG approaches have focused on extracting domaininvariant information across sources to generalize on target domains, while useful domain-specific information which strongly correlates with labels in individual domains and the generalization to target domains is usually ignored. In this paper, we propose meta-Domain Specific-Domain Invariant (mDSDI) -a novel theoretically sound framework that extends beyond the invariance view to further capture the usefulness of domain-specific information. Our key insight is to disentangle features in the latent space while jointly learning both domain-invariant and domainspecific features in a unified framework. The domain-specific representation is optimized through the meta-learning framework to adapt from source domains, targeting a robust generalization on unseen domains. We empirically show that mDSDI provides competitive results with state-of-the-art techniques in DG. A further ablation study with our generated dataset, Background-Colored-MNIST, confirms the hypothesis that domain-specific is essential, leading to better results when compared with only using domain-invariant.

For agents

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

get_harvested_code_for_paper("2110.09410")
get_code_for_paper("2110.09410")
have("2110.09410")

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

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

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

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

Connect an agent — have() is free.