SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.07888 · 2023

Consistency Regularization for Domain Generalization with Logit Attribution Matching

arXiv · PDF · Open in the Atlas

Code that ran

7 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 7 have no contract verdict; 0 failures of our instrument; 4 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/2305.07888.json · badge: /api/ran/2305.07888.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
gaohan123/lam canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
get_argmax_valid Ran
ran on a synthesized input
gaohan123/lam/utils.py
code served (permissive licence) · get_code("bada690a17a379cb")
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 1, dtype family int, shape (2,) 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

# Construct valid arguments for get_argmax_valid
# The function takes logits (shape: batch_size x num_classes) and valid_indices (indices into classes)
# It selects only the valid class columns, finds argmax, then maps back to original indices

batch_size = 2
num_classes = 4
num_valid = 3

# Create logits: shape (batch_size, num_classes)
logits = np.random.randn(batch_size, num_classes).astype(np.float32)

# Create valid_indices: a list of 3 unique indices from range(num_classes)
# These represent which class indices are valid
valid_indices = [0, 2, 3]

ARGS = {
    "logits": logits,
    "valid_indices": valid_indices,
}
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 1, dtype family int, shape (2,) — shape (2,) 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_bbox Ran
ran on a synthesized input
gaohan123/lam/copy_paste_aug/wild_mask_bbox.py
code served (permissive licence) · get_code("7a5537948fe58d0d")
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 pandas as pd
import numpy as np

# Create a small DataFrame that mimics the expected structure
# The function expects bbox_df to have:
# - an index that can be queried with image_id
# - columns 'detections' and 'max_detection_conf'

bbox_data = {
    'detections': [
        [{'bbox': [10, 20, 30, 40]}, {'bbox': [50, 60, 70, 80]}],
        [{'bbox': [15, 25, 35, 45]}]
    ],
    'max_detection_conf': [0.75, 0.45]
}

bbox_df = pd.DataFrame(bbox_data, index=['img_001', 'img_002'])

image_id = 'img_001'

ARGS = {
    'bbox_df': bbox_df,
    'image_id': image_id
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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_empty_img_by_y Ran
ran on a synthesized input
gaohan123/lam/copy_paste_aug/select_bg.py
code served (permissive licence) · get_code("8861e302edc9b24c")
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 torch
import numpy as np

torch.manual_seed(0)

class MockDataset:
    def __init__(self):
        # Create sample data
        self.empty_indices = np.array([0, 2, 4, 5, 7])
        self.location_array = np.array([10, 20, 10, 30, 20, 10, 40, 20])
        self.y_to_observed_locs = {
            1: np.array([10, 20]),
            2: np.array([30, 40])
        }
        self._input_array = np.array([
            "img_0.jpg",
            "img_1.jpg", 
            "img_2.jpg",
            "img_3.jpg",
            "img_4.jpg",
            "img_5.jpg",
            "img_6.jpg",
            "img_7.jpg"
        ])

dataset = MockDataset()
y = 1

ARGS = {
    "dataset": dataset,
    "y": y
}
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 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
isin Ran
ran on a synthesized input
gaohan123/lam/copy_paste_aug/select_bg.py
code served (permissive licence) · get_code("b34edff3ffec4fa0")
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 float, shape (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 torch
import numpy as np

torch.manual_seed(0)

# Create small test tensors
elements = torch.tensor([1, 2, 3, 4])
test_elements = torch.tensor([2, 4, 6, 8])

ARGS = {
    "elements": elements,
    "test_elements": test_elements
}
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 Tensor, ndim 1, dtype family float, shape (4,) — shape (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
make_checkpoints_dir Ran
ran on a synthesized input
gaohan123/lam/utils.py
code served (permissive licence) · get_code("0de6908df376c724")
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 PosixPath. 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
from pathlib import Path
import tempfile

# Create a temporary directory to use as log_dir
temp_dir = tempfile.mkdtemp()

ARGS = {
    'log_dir': temp_dir
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
sample_empty_img_given_mask Ran
ran on a synthesized input
gaohan123/lam/copy_paste_aug/select_bg.py
code served (permissive licence) · get_code("0e2fc0ac5d13251f")
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 torch
import numpy as np

class MockDataset:
    def __init__(self):
        # empty_indices should be a numpy array that labeled_mask can index into
        self.empty_indices = np.array([0, 2, 5, 7, 9])
        # _input_array maps indices to image names
        self._input_array = {
            0: "bg_image_0.jpg",
            2: "bg_image_2.jpg",
            5: "bg_image_5.jpg",
            7: "bg_image_7.jpg",
            9: "bg_image_9.jpg",
        }

# Create dataset instance
dataset = MockDataset()

# Create labeled_mask as a torch tensor with same length as empty_indices
# The mask should have some True values so np.random.choice can work
labeled_mask = torch.tensor([True, False, True, False, True])

# Verify the mask length matches empty_indices length
assert len(labeled_mask) == len(dataset.empty_indices)

ARGS = {
    "dataset": dataset,
    "labeled_mask": labeled_mask,
}
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 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
xywh_to_xyxy Ran
ran on a synthesized input
gaohan123/lam/copy_paste_aug/wild_mask_bbox.py
code served (permissive licence) · get_code("427485a15e05cc2c")
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 int; 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

torch.manual_seed(0)

# The function takes scalar or array-like inputs for x, y, w, h
# and an optional boolean xy_center parameter
# It performs arithmetic operations on these values and returns a tuple of ints

ARGS = {
    'x': 10,
    'y': 20,
    'w': 50,
    'h': 30,
    'xy_center': 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 tuple, ndim 1, dtype family int — 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
build_model Not yet run
unverified (harvested, no recorded run)
gaohan123/lam/src/models/model_utils.py
code served (permissive licence) · get_code("2004e8d9ede9e29c")
How it ran

no invocation recorded.

copy_paste_augmentation Not yet run
unverified (harvested, no recorded run)
gaohan123/lam/train_lam.py
code served (permissive licence) · get_code("8d54de902865d503")
How it ran

no invocation recorded.

get_mask Not yet run
unverified (harvested, no recorded run)
gaohan123/lam/copy_paste_aug/wild_mask_bbox.py
code served (permissive licence) · get_code("05ae9c1f9ae97e0b")
How it ran

no invocation recorded.

get_param_weights_counts Not yet run
unverified (harvested, no recorded run)
gaohan123/lam/src/models/model_utils.py
code served (permissive licence) · get_code("d13d13177ef6bd70")
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, 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 11 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-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) is about training models that generalize well under domain shift. Previous research on DG has been conducted mostly in single-source or multi-source settings. In this paper, we consider a third, lesser-known setting where a training domain is endowed with a collection of pairs of examples that share the same semantic information. Such semantic sharing (SS) pairs can be created via data augmentation and then utilized for consistency regularization (CR). We present a theory showing CR is conducive to DG and propose a novel CR method called Logit Attribution Matching (LAM). We conduct experiments on five DG benchmarks and four pretrained models with SS pairs created by both generic and targeted data augmentation methods. LAM outperforms representative single/multi-source DG methods and various CR methods that leverage SS pairs. The code and data of this project are available at https://github.com/Gaohan123/LAM

For agents

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

get_harvested_code_for_paper("2305.07888")
get_code_for_paper("2305.07888")
have("2305.07888")

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

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

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

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

Connect an agent — have() is free.