This is the code to reproduce the experiments of my blog post, which explains and gives implementation details on Temporal Ensembling for Semi-Supervised Learning from ICLR 2017.
Accuracy on weakly-supervised MNIST (100 labels, 5 seed restarts) : 97.8% (+/- 0.6%).
Best seed accuracy : 98.38%.
First, install the requirements in a virtual environment :
pip install -r requirements.txt
I used PyTorch version 0.3.0.post4 and torchvision version 0.2.0, so these are the recommended versions.
If you want to run it using PyTorch 0.4+, see this issue.
Install PyTorch and torchvision as shown here according to your specs.
You can launch a MNIST evaluation from the command line using :
python mnist_eval.py
You can tweak hyperparameters in the config.py file.
This code is not a 100% faithful reproduction of the original paper and should not be used as such.
The Theano-based code released by the paper authors can be found here.