PyTorch's re-implementation of SimCLR on CIFAR-10/100 on multiple GPUs.
python launch.py --nproc_per_node=4 -m main parameter.epochs=200
python launch.py --nproc_per_node=4 -m main parameter.epochs=1000 # longer training
The default classifier is centroid classifier.
python -m eval experiment.target_dir=PATH_TO_TRAINED_WEIGHTS
python -m eval parameter.classifier=linear experiment.target_dir=PATH_TO_TRAINED_WEIGHTS
python -m eval parameter.classifier=nonlinear experiment.target_dir=PATH_TO_TRAINED_WEIGHTS
Note: The reported accuracies are the best validation accuracies.
Classifier | With projection head | Without projection head |
---|---|---|
Centroid | 0.7328 | 0.5271 |
Linear | 0.7868 | 0.8225 |
Nonlinear | 0.7946 | 0.8370 |
Classifier | With projection head | Without projection head |
---|---|---|
Centroid | 0.8440 | 0.8442 |
Linear | 0.8665 | 0.8937 |
Nonlinear | 0.8759 | 0.8941 |
python launch.py --nproc_per_node=4 -m supervised parameter.epochs=200
The best validation accuracy is 92.75%
.
- Ting Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey Hinton. A Simple Framework for Contrastive Learning of Visual Representations, In ICML, 2020.