/meanteacher-pytorch

MeanTeacher and PI model with pytorch >= 0.4

Primary LanguageShell

MeanTeacher-PyTorch

The repository implement two semi-supervised deep learning methods, MeanTeacher and PI model. More details for the method please refer to Mean teacher are better role models: Wegiht-averaged consistency targets improve semi-supervised deep learning results and Temporal Ensembling for Semi-supervised Learning.

This repository is based on the official repository of mean-teacher@CuriousAI. And there are not only ConvLarge Net implemented, but also other popular networks (come from pytorch-cifar@kuangliu).

I implemet PI model as a special case of MeanTeacher when smoothing coefficient hyperparameter is zero.

The environment:

  • Python 3.6.5::Anaconda

  • PyTorch >= 0.4.0

  • torchvision 0.2.1

  • tensorboardX (for log)

  • tensorflow (for visualization)

To prepare the data:

bash data-local/bin/prepare_cifar10.sh

To run the code:

python -m experiments.ema_test

or

python -m experiments.pi_test

Visualization:

Make sure you have installed the tensorflow for tensorboard

tensorboard --logdir runs

Code Reference

pytorch-cifar@kuangliu

mean-teacher@CuriousAI