Skip to content

Training, adaptation, compression, and systems techniques · Training, fine-tuning, adaptation, compression, and systems techniques · TRN038 · Training method

FixMatch

Combines confidence-thresholded pseudo-labels from weak augmentations with training on strongly augmented unlabeled examples.

Runs in CodeSplash (Experimental) Component demo, not a trained model CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page. The methods that run it are Experimental.

Do it in CodeSplash Run it on your own data. It's in the Experimental lane in the app.

Availability
Runs in CodeSplash (Experimental)
Code example
Component demo, not a trained model
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through learn.cnn. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Combines confidence-thresholded pseudo-labels from weak augmentations with training on strongly augmented unlabeled examples.

Question / hypotheses

Does this intervention improve the intended quality, adaptation, resource, or reliability objective under a controlled comparison? It defines a method, not an intrinsic null-hypothesis test.

Architecture / computational structure

One model predicts a hard pseudo-label on a weak view; the strong view receives that label only when confidence exceeds a threshold.

Assumptions

Weak/strong augmentations must preserve class identity and unlabeled data should overlap the target label space. Confidence may be miscalibrated.

Formula / computational definition

Lu=1B∑i1{max⁡pi≥τ}H(arg⁡max⁡pi,pθ(y∣Astrong(xi))).L_u=\frac1B\sum_i\mathbf1\{\max p_i\ge\tau\}H(\arg\max p_i,p_\theta(y\mid A_{strong}(x_i))).

Parameters and notation

Learned: classifier weights. Hyperparameters: threshold tau, unlabeled/labeled batch ratio, loss weight, augmentation policy, learning rate, class-balance handling.

Fitting, fine-tuning, and adaptation

Train with a small labeled set and a separate unlabeled pool; monitor accepted pseudo-label counts by class. Tune on labeled development data, not test labels.

How to use and calibrate

Compare supervised-only and semi-supervised learning curves at equal annotation budgets. Example: adapt an image classifier with many unlabeled examples.

Example application

adapt an image classifier with many unlabeled examples.

Interpretation / pitfalls

Watch out

High-confidence errors can become self-reinforcing. A high threshold may exclude rare/hard classes; out-of-class unlabeled data can corrupt training.

Python and R code examples

Scope: numerical mechanism demonstration. Validation: Python executed successfully on the supplied synthetic inputs; R reviewed but not executed (Rscript unavailable).

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Component demo, not a trained model — numerical mechanism demonstration. · needs numpy

import numpy as np
weak=np.array([[.95,.05],[.55,.45]]); strong=np.array([[.8,.2],[.4,.6]]); mask=weak.max(1)>=.9
y=weak.argmax(1); print(np.mean(mask*(-np.log(strong[np.arange(2),y]))))
R

Component demo, not a trained model — numerical mechanism demonstration.

weak <- rbind(c(.95,.05),c(.55,.45)); strong <- rbind(c(.8,.2),c(.4,.6)); mask <- apply(weak,1,max)>=.9
y <- max.col(weak); print(mean(mask*(-log(strong[cbind(1:2,y)]))))

Sources

From the CodeSplash reference, entry TRN038.