SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2110.08263 · NeurIPS · 2021

FlexMatch: Boosting Semi-Supervised Learning with Curriculum Pseudo Labeling

Jindong Wang, Hao Wu, Bowen Zhang, Yidong Wang, Wenxin Hou, Manabu Okumura, Takahiro Shinozaki

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 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, 1 violated it and 0 have no contract verdict; 3 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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.08263.json · badge: /api/ran/2110.08263.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
torchssl/torchssl canonical (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
beandkay/sequencematch community
Papers with Code archive
2 ran · 1 no recorded run
FunctionStatusWhere it lives
ce_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
beandkay/sequencematch/models/flexmatch/flexmatch.py
code served (permissive licence) · get_code("1b2ef05b7424074f")
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 (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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Setup for use_hard_labels=True case
batch_size = 2
num_classes = 4

logits_hard = torch.randn(batch_size, num_classes)
targets_hard = torch.tensor([0, 2], dtype=torch.long)

# Setup for use_hard_labels=False case (soft targets)
logits_soft = torch.randn(batch_size, num_classes)
targets_soft = torch.tensor([
    [0.7, 0.1, 0.1, 0.1],
    [0.0, 0.2, 0.8, 0.0]
], dtype=torch.float)

# Test with hard labels
ARGS = {
    'logits': logits_hard,
    'targets': targets_hard,
    'use_hard_labels': True,
    'reduction': 'none'
}
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 Tensor, ndim 1, dtype family float, 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
consistency_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
torchssl/torchssl/models/flexmatch/flexmatch.py
code served (permissive licence) · get_code("8f89311db3715e3c")
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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Define small tensors
batch_size = 2
num_classes = 4

# logits_s: student logits [batch_size, num_classes]
logits_s = torch.randn(batch_size, num_classes)

# logits_w: weak/teacher logits [batch_size, num_classes]
logits_w = torch.randn(batch_size, num_classes)

# class_acc: per-class accuracy [num_classes]
class_acc = torch.tensor([0.8, 0.7, 0.9, 0.6])

# p_target: target class distribution [num_classes]
p_target = torch.ones(num_classes) / num_classes

# p_model: model's class distribution [num_classes]
p_model = torch.ones(num_classes) / num_classes

ARGS = {
    'logits_s': logits_s,
    'logits_w': logits_w,
    'class_acc': class_acc,
    'p_target': p_target,
    'p_model': p_model,
    'name': 'ce',
    'T': 1.0,
    'p_cutoff': 0.0,
    'use_hard_labels': True,
    'use_DA': 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 — 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
consistency_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
beandkay/sequencematch/models/flexmatch/flexmatch.py
code served (permissive licence) · get_code("45956241e5216b30")
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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Small tensors: batch_size=2, num_classes=4
batch_size = 2
num_classes = 4

# logits_s: student logits [batch_size, num_classes]
logits_s = torch.randn(batch_size, num_classes)

# logits_w: weak logits [batch_size, num_classes]
logits_w = torch.randn(batch_size, num_classes)

# class_acc: class accuracy [num_classes]
class_acc = torch.tensor([0.8, 0.7, 0.9, 0.6])

# p_target: target class distribution [num_classes]
p_target = torch.tensor([0.25, 0.25, 0.25, 0.25])

# p_model: model class distribution [num_classes]
p_model = torch.tensor([0.3, 0.2, 0.3, 0.2])

ARGS = {
    'logits_s': logits_s,
    'logits_w': logits_w,
    'class_acc': class_acc,
    'p_target': p_target,
    'p_model': p_model,
    'name': 'ce',
    'T': 1.0,
    'p_cutoff': 0.5,
    'use_hard_labels': True,
    'use_DA': 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 — 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
str2bool Ran
ran, violated the contract we drafted
torchssl/torchssl/flexmatch.py
code served (permissive licence) · get_code("8605dc8a088f3db8")
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) and returned bool, 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 argparse

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for the str2bool function
ARGS = {
    'v': 'true'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 bool, 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
FlexMatch Not yet run
unverified (harvested, no recorded run)
torchssl/torchssl/models/flexmatch/flexmatch.py
code served (permissive licence) · get_code("ab70368712a20243")
How it ran

no invocation recorded.

FlexMatch Not yet run
unverified (harvested, no recorded run)
beandkay/sequencematch/models/flexmatch/flexmatch.py
code served (permissive licence) · get_code("865b358a0b1a7755")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 3 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
str2bool 175 other papers
42 dated earlier, 133 later · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
ce_loss
brick of this paper's assembly: loss
7 other papers
7 later · 5 only as an assembly brick
2203.02533 (2022-03)
BoostMIS: Boosting Medical Image Semi-supervised Learning with Adaptive Pseudo Labeling and Informative Active Annotation
2205.07246 (2022-05)
FreeMatch: Self-adaptive Thresholding for Semi-supervised Learning
2208.08631 (2022-08)
ConMatch: Semi-Supervised Learning with Confidence-Guided Consistency Regularization
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-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

The recently proposed FixMatch achieved state-of-the-art results on most semisupervised learning (SSL) benchmarks. However, like other modern SSL algorithms, FixMatch uses a pre-defined constant threshold for all classes to select unlabeled data that contribute to the training, thus failing to consider different learning status and learning difficulties of different classes. To address this issue, we propose Curriculum Pseudo Labeling (CPL), a curriculum learning approach to leverage unlabeled data according to the model's learning status. The core of CPL is to flexibly adjust thresholds for different classes at each time step to let pass informative unlabeled data and their pseudo labels. CPL does not introduce additional parameters or computations (forward or backward propagation). We apply CPL to FixMatch and call our improved algorithm FlexMatch. FlexMatch achieves state-of-the-art performance on a variety of SSL benchmarks, with especially strong performances when the labeled data are extremely limited or when the task is challenging. For example, FlexMatch achieves 13.96% and 18.96% error rate reduction over FixMatch on CIFAR-100 and STL-10 datasets respectively, when there are only 4 labels per class. CPL also significantly boosts the convergence speed, e.g., FlexMatch can use only 1/5 training time of FixMatch to achieve even better performance. Furthermore, we show that CPL can be easily adapted to other SSL algorithms and remarkably improve their performances. We open-source our code at https://github.com/TorchSSL/TorchSSL.

For agents

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

get_harvested_code_for_paper("2110.08263")
get_code_for_paper("2110.08263")
have("2110.08263")

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

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

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

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

Connect an agent — have() is free.