A PyTorch implementation of SimSiam based on CVPR 2021 paper Exploring Simple Siamese Representation Learning.
conda install pytorch=1.7.1 torchvision cudatoolkit=10.2 -c pytorch
- thop
pip install thop
CIFAR10
dataset is used in this repo, the dataset will be downloaded into data
directory by PyTorch
automatically.
python main.py --batch_size 256 --epochs 1000
optional arguments:
--feature_dim Feature dim for out vector [default value is 2048]
--k Top k most similar images used to predict the label [default value is 200]
--batch_size Number of images in each mini-batch [default value is 512]
--epochs Number of sweeps over the dataset to train [default value is 800]
python linear.py --batch_size 512 --epochs 100
optional arguments:
--model_path The pretrained model path [default value is 'results/2048_200_512_800_model.pth']
--batch_size Number of images in each mini-batch [default value is 256]
--epochs Number of sweeps over the dataset to train [default value is 90]
The model is trained on one NVIDIA GeForce TITAN X(12G) GPU.
Evaluation Protocol | Params (M) | FLOPs (M) | Feature Dim | Batch Size | Epoch Num | K | Top1 Acc % | Top5 Acc % | Download |
---|---|---|---|---|---|---|---|---|---|
KNN | 18.52 | 564.00 | 2048 | 512 | 800 | 200 | 88.1 | 99.1 | model | f7yj |
Linear | 11.17 | 556.66 | - | 256 | 90 | - | 90.1 | 99.6 | model | v8mf |