SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.07500 · ICML · 2021

Domain Generalization using Causal Matching

Divyat Mahajan, Shruti Tople, Amit Sharma

arXiv · PDF · Open in the Atlas

Code that ran

4 of 9 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 0 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2006.07500.json · badge: /api/ran/2006.07500.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
biomedia-mira/masf unrelated (classifier label)
classifier basis: classifier_2025
4 ran · 4 no recorded run
vihari/CSD community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
conv_block Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("d7335824a1d78b44")
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 EagerTensor, ndim 4, dtype family float, shape (2, 2, 2, 8) 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)

# Create small test tensors
batch_size = 2
height = 4
width = 4
in_channels = 3
out_channels = 8
kernel_size = 3

# Input tensor: [batch, height, width, channels]
inp = tf.constant(np.random.randn(batch_size, height, width, in_channels).astype(np.float32))

# Convolution weight tensor: [kernel_h, kernel_w, in_channels, out_channels]
cweight = tf.constant(np.random.randn(kernel_size, kernel_size, in_channels, out_channels).astype(np.float32))

# Bias weight tensor: [out_channels]
bweight = tf.constant(np.random.randn(out_channels).astype(np.float32))

ARGS = {
    'inp': inp,
    'cweight': cweight,
    'bweight': bweight,
    'stride_y': 2,
    'stride_x': 2,
    'groups': 1,
    'reuse': False,
    'scope': ''
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 2, 2, 8) — shape (2, 2, 2, 8) 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
dropout Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("2ff962d151152c2e")
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 EagerTensor, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor for x
x = tf.constant(np.random.randn(2, 4).astype(np.float32))

# Set keep_prob to 0.8 (keep 80% of the neurons during training)
keep_prob = 0.8

ARGS = {
    "x": x,
    "keep_prob": keep_prob,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
lrn Ran
ran; our contract draft was wrong, not the code
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("99c3561f7772f982")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 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 tensorflow as tf
import numpy as np

# Create a small 4D tensor for local response normalization
# Shape: (batch=2, height=4, width=3, channels=4)
x = tf.constant(np.random.randn(2, 4, 3, 4).astype(np.float32))

# Define parameters
radius = 2
alpha = 0.0001
beta = 0.75
bias = 1.0

ARGS = {
    "x": x,
    "radius": radius,
    "alpha": alpha,
    "beta": beta,
    "bias": bias,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 3, 4) — shape (2, 4, 3, 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
max_pool Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("8621037738dc0c34")
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 EagerTensor, ndim 4, dtype family float, shape (2, 4, 5, 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 tensorflow as tf
import numpy as np

# Create a small input tensor for max pooling
# Shape: [batch, height, width, channels] = [2, 4, 5, 3]
x = tf.constant(np.random.randn(2, 4, 5, 3).astype(np.float32))

# Define max pooling parameters
filter_height = 2
filter_width = 2
stride_y = 1
stride_x = 1
padding = 'SAME'

ARGS = {
    'x': x,
    'filter_height': filter_height,
    'filter_width': filter_width,
    'stride_y': stride_y,
    'stride_x': stride_x,
    'padding': padding
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 4, 5, 3) — shape (2, 4, 5, 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
MASF Not yet run
unverified (harvested, no recorded run)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("65a7aed081f03f65")
How it ran

no invocation recorded.

ResNetCSD Not yet run
unverified (harvested, no recorded run)
vihari/CSD/pacs/models/resnet_csd.py
code served (permissive licence) · get_code("8ff91b49667f3978")
How it ran

no invocation recorded.

fc Not yet run
unverified (harvested, no recorded run)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("eac7e24272801635")
How it ran

no invocation recorded.

kd Not yet run
unverified (harvested, no recorded run)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("62dd1a96ab6840ef")
How it ran

no invocation recorded.

xent Not yet run
unverified (harvested, no recorded run)
biomedia-mira/masf/masf_func.py
code served (permissive licence) · get_code("0bf65cfc625e3b75")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

In the domain generalization literature, a common objective is to learn representations independent of the domain after conditioning on the class label. We show that this objective is not sufficient: there exist counter-examples where a model fails to generalize to unseen domains even after satisfying class-conditional domain invariance. We formalize this observation through a structural causal model and show the importance of modeling within-class variations for generalization. Specifically, classes contain objects that characterize specific causal features, and domains can be interpreted as interventions on these objects that change non-causal features. We highlight an alternative condition: inputs across domains should have the same representation if they are derived from the same object. Based on this objective, we propose matching-based algorithms when base objects are observed (e.g., through data augmentation) and approximate the objective when objects are not observed (MatchDG). Our simple matching-based algorithms are competitive to prior work on out-of-domain accuracy for rotated MNIST, Fashion-MNIST, PACS, and Chest-Xray datasets. Our method MatchDG also recovers ground-truth object matches: on MNIST and Fashion-MNIST, top-10 matches from MatchDG have over 50% overlap with ground-truth matches.

For agents

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

get_harvested_code_for_paper("2006.07500")
get_code_for_paper("2006.07500")
have("2006.07500")

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

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

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

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

Connect an agent — have() is free.