Home

Awesome

FixMatch

This is an unofficial PyTorch implementation of FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence. The official Tensorflow implementation is here.

This code is only available in FixMatch (RandAugment).

Results

CIFAR10

#Labels402504000
Paper (RA)86.19 ± 3.3794.93 ± 0.6595.74 ± 0.05
This code93.6095.3195.77
Acc. curvelinklinklink

* November 2020. Retested after fixing EMA issues.

CIFAR100

#Labels400250010000
Paper (RA)51.15 ± 1.7571.71 ± 0.1177.40 ± 0.12
This code57.5072.9378.12
Acc. curvelinklinklink

* Training using the following options --amp --opt_level O2 --wdecay 0.001

Usage

Train

Train the model by 4000 labeled data of CIFAR-10 dataset:

python train.py --dataset cifar10 --num-labeled 4000 --arch wideresnet --batch-size 64 --lr 0.03 --expand-labels --seed 5 --out results/cifar10@4000.5

Train the model by 10000 labeled data of CIFAR-100 dataset by using DistributedDataParallel:

python -m torch.distributed.launch --nproc_per_node 4 ./train.py --dataset cifar100 --num-labeled 10000 --arch wideresnet --batch-size 16 --lr 0.03 --wdecay 0.001 --expand-labels --seed 5 --out results/cifar100@10000

Monitoring training progress

tensorboard --logdir=<your out_dir>

Requirements

My other implementations

References

Citations

@misc{jd2020fixmatch,
  author = {Jungdae Kim},
  title = {PyTorch implementation of FixMatch},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/kekmodel/FixMatch-pytorch}}
}