SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2308.09037 · CVPR · 2023

MarginMatch: Improving Semi-Supervised Learning with Pseudo-Margins

Cornelia Caragea, Tiberiu Sosea

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 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; 2 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/2308.09037.json · badge: /api/ran/2308.09037.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
tsosea2/MarginMatch community
Papers with Code archive
5 ran · 2 no recorded run
FunctionStatusWhere it lives
AUMCalculator Ran
ran on a synthesized input · constructed an object; no result was computed
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("71af214f56a51e51")
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, AUMCalculator: 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 numpy as np

ARGS = {
    "margin_smoothing": 0.1,
    "num_labels": 4,
    "num_examples": 10,
    "percentile": 50
}
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 AUMCalculator — 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 AUMCalculator 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
DistributedProxySampler Ran
ran on a synthesized input · constructed an object; no result was computed
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("a715f082b07cddad")
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, DistributedProxySampler: 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
from torch.utils.data import sampler, DataLoader

# Define a simple proxy sampler that yields indices
class SimpleProxySampler(sampler.Sampler):
    def __init__(self, size):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __iter__(self):
        return iter(range(self.size))

# Construct the arguments
torch.manual_seed(0)

# Create a simple sampler with 16 elements
input_sampler = SimpleProxySampler(size=16)

# Set up distributed parameters
num_replicas = 2
rank = 0

ARGS = {
    "sampler": input_sampler,
    "num_replicas": num_replicas,
    "rank": rank,
}
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 DistributedProxySampler — 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 DistributedProxySampler 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
consistency_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("d3050212d4076500")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)
np.random.seed(0)

# Mock AUM Calculator class
class MockAUMCalculator:
    def __init__(self, num_samples, num_classes):
        self.aums = np.random.randn(num_samples, num_classes)
    
    def update_aums(self, ids, margins):
        pass
    
    def get_aums(self, ids):
        return self.aums[ids]

# Setup batch size and dimensions
batch_size = 2
num_classes = 4
num_unlabeled_samples = 10

# Create tensors
logits_s = torch.randn(batch_size, num_classes)
logits_w = torch.randn(batch_size, num_classes)
x_ulb_idx = torch.tensor([0, 1], dtype=torch.long)
y_ulb = torch.tensor([0, 2], dtype=torch.long)

# Create confidence accuracy per class
conf_acc = torch.tensor([0.8, 0.75, 0.9, 0.7])

# Prior target distribution
p_target = torch.ones(num_classes - 1) / (num_classes - 1)

# AUM calculator
aum_calculator = MockAUMCalculator(num_unlabeled_samples, num_classes)

# Threshold mask
threshold_mask = torch.tensor([False, True], dtype=torch.bool)

# p_model (class distribution model)
p_model = None

ARGS = {
    'logits_s': logits_s,
    'logits_w': logits_w,
    'conf_acc': conf_acc,
    'p_target': p_target,
    'p_model': p_model,
    'x_ulb_idx': x_ulb_idx,
    'aum_calculator': aum_calculator,
    'y_ulb': y_ulb,
    'crt_threshold': None,
    'num_classes': num_classes,
    'threshold_mask': threshold_mask,
    'name': 'ce',
    'T': 1.0,
    'p_cutoff': 0.0,
    'use_hard_labels': True,
    'use_DA': False,
    'labels': True
}
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 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_data_loader Ran
ran on a synthesized input
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("4d1e29ceead9441e")
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
from torch.utils.data import Dataset
from torch.utils.data.sampler import RandomSampler

torch.manual_seed(0)

# Create a minimal dataset
class DummyDataset(Dataset):
    def __init__(self, size=10):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return torch.randn(4), torch.randint(0, 2, (1,))

dset = DummyDataset(size=10)

ARGS = {
    'dset': dset,
    'batch_size': 2,
    'shuffle': False,
    'num_workers': 0,
    'pin_memory': False,
    'data_sampler': None,
    'replacement': True,
    'num_epochs': None,
    'num_iters': None,
    'generator': None,
    'drop_last': True,
    'distributed': 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
get_sampler_by_name Ran
ran; our contract draft was wrong, not the code
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("6a7921f1a96a77f1")
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 type. 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
from torch.utils.data import sampler, DataLoader

torch.manual_seed(0)

ARGS = {
    'name': 'RandomSampler'
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
MarginMatch Not yet run
unverified (harvested, no recorded run)
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("699381f39fd78579")
How it ran

no invocation recorded.

replace_threshold_examples Not yet run
unverified (harvested, no recorded run)
tsosea2/MarginMatch/models/marginmatch/marginmatch.py
code served (permissive licence) · get_code("3e9725d71807eec6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 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 6 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
get_sampler_by_name
brick of this paper's assembly: helper
1 other paper
1 dated earlier
136970483 (2022 (year only))
S 2 -VER: Semi-Supervised Visual Emotion Recognition

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

We introduce MarginMatch, a new SSL approach combining consistency regularization and pseudo-labeling, with its main novelty arising from the use of unlabeled data training dynamics to measure pseudo-label quality. Instead of using only the model's confidence on an unlabeled example at an arbitrary iteration to decide if the example should be masked or not, MarginMatch also analyzes the behavior of the model on the pseudo-labeled examples as the training progresses, to ensure low quality predictions are masked out. MarginMatch brings substantial improvements on four vision benchmarks in low data regimes and on two large-scale datasets, emphasizing the importance of enforcing highquality pseudo-labels. Notably, we obtain an improvement in error rate over the state-of-the-art of 3.25% on CIFAR-100 with only 25 labels per class and of 3.78% on STL-10 using as few as 4 labels per class. We make our code available at https://github.com/tsosea2/MarginMatch.

For agents

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

get_harvested_code_for_paper("2308.09037")
get_code_for_paper("2308.09037")
have("2308.09037")

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

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

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

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

Connect an agent — have() is free.