A PyTorch implementation of NPID based on CVPR 2018 paper Unsupervised Feature Learning via Non-Parametric Instance Discrimination.
conda install pytorch=1.3.1 torchvision cudatoolkit=10.0 -c pytorch
CIFAR10
dataset is used in this repo, the dataset will be downloaded by PyTorch
automatically.
python train.py --epochs 50 --feature_dim 256
optional arguments:
--feature_dim Feature dim for each image [default value is 128]
--m Negative sample number [default value is 4096]
--temperature Temperature used in softmax [default value is 0.1]
--momentum Momentum used for the update of memory bank [default value is 0.5]
--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 128]
--epochs Number of sweeps over the dataset to train [default value is 200]
Backbone | feature dim | batch size | epoch num | temperature | momentum | k | Top1 Acc % | Top5 Acc % | download link |
---|---|---|---|---|---|---|---|---|---|
ResNet18 | 128 | 128 | 200 | 0.1 | 0.5 | 200 | 80.64 | 98.56 | model | v7qm |