simclr
SimCLRv2 - Big Self-Supervised Models are Strong Semi-Supervised Learners
File Explorer
- digits_on_tf_flowers.ipynb
- generalized_contrastive_loss.ipynb
- randbits_mnist.ipynb
- README.md
- distillation_self_training.ipynb
- finetuning.ipynb
- load_and_inference.ipynb
- 10percent.txt
- 1percent.txt
- distillation_self_training.ipynb
- finetuning.ipynb
- imagenet_results.ipynb
- load_and_inference.ipynb
- data.py
- data_util.py
- lars_optimizer.py
- metrics.py
- model.py
- objective.py
- README.md
- requirements.txt
- resnet.py
- run.py
- CONTRIBUTING.md
- data.py
- data_util.py
- lars_optimizer.py
- LICENSE
- model.py
- model_util.py
- objective.py
- README.md
- requirements.txt
- resnet.py
- run.py
# Installation Guide
python- Python 3.x
- TensorFlow v1 or v2
- Google Cloud TPU (Optional) null
Setup Steps
pip install -r requirements.txt
Install required python package dependencies.
python run.py --train_mode=pretrain --dataset=cifar10 ...
Pretrain the model on a single GPU environment.
Key Commands
pip install -r requirements.txt
Install python library packages required for the project.
python run.py --train_mode=pretrain --train_batch_size=512 --train_epochs=1000 --learning_rate=1.0 --weight_decay=1e-4 --temperature=0.5 --dataset=cifar10 --image_size=32 --eval_split=test --resnet_depth=18 --use_blur=False --color_jitter_strength=0.5 --model_dir=/tmp/simclr_test --use_tpu=False
Pretrain the model using CIFAR-10 or ImageNet datasets.
python run.py --mode=train_then_eval --train_mode=finetune --fine_tune_after_block=4 --zero_init_logits_layer=True --variable_schema='(?!global_step|(?:.*/|^)Momentum|head)' --global_bn=False --optimizer=momentum --learning_rate=0.1 --weight_decay=0.0 --train_epochs=100 --train_batch_size=512 --warmup_epochs=0 --dataset=cifar10 --image_size=32 --eval_split=test --resnet_depth=18 --checkpoint=/tmp/simclr_test --model_dir=/tmp/simclr_test_ft --use_tpu=False
Fine-tune the linear head of the pretrained model.
# Use via CDN
jsDelivrjsDelivr serves any public GitHub repository as a CDN with zero setup. Pick a version and a file to get a ready-to-paste link and snippet.
Command Glossary
Commands referenced in this DOCs, explained below.
pip install
View Details ▼
pip install
Install Python packages.
pip install {{package1 package2 ...}}
Install one or more packages:
pip install {{package1 package2 ...}} {{[-U|--upgrade]}}
Upgrade all specified packages to the latest version, installing any that are not already present:
pip install {{package}}=={{version}}
Install a specific version of a package:
python
View Details ▼
python
Python language interpreter.
python
Start a REPL (interactive shell):
python {{path/to/file.py}}
Execute a specific Python file:
python -i {{path/to/file.py}}
Execute a specific Python file and start a REPL:
