Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

wgcban/MNN

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MNN: Mixed Nearest Neighbors for Self-Supervised Learning

This is an PyTorch implementation of MNN proposed by our paper MNN: Mixed Nearest-Neighbors for Self-Supervised Learning. If you find this repo useful, welcome 🌟🌟🌟✨.

figure1

Requirements

To install requirements:

# name: d2lpy39
conda env create -f environment.yml

Training

(You need to create the directory './stdout', you can also omit '>stdout/*' so that you can run these commands directly.) To train the model(s) in the paper, run those commands:

nohup python main.py --name mnn --momentum 0.99 --symmetric --weak --topk 5 --dataset cifar10 --gpuid 0 --logdir cifar10_00 --aug_numbers 2 --random_lamda >stdout/cifar10_00 2>&1 &
nohup python main.py --name mnn --momentum 0.99 --symmetric --weak --topk 5 --dataset cifar100 --gpuid 0 --logdir cifar100_00 --aug_numbers 2 --random_lamda >stdout/cifar100_00 2>&1 &
nohup python main.py --name mnn --momentum 0.996 --symmetric --weak --topk 5 --dataset tinyimagenet --gpuid 0 --logdir tinyimagenet_00 --aug_numbers 2 --queue_size 16384 --random_lamda >stdout/tinyimagenet_00 2>&1 &

Evaluation

To evaluate our model on CIFAR10/100 and Tiny-imagenet, run:

nohup python linear_eval.py --name mnn --dataset cifar10 --gpuid 0 --logdir cifar10_00 --seed 1339  >stdout/cifar10_00_01 2>&1 &
nohup python linear_eval.py --name mnn --dataset cifar100 --gpuid 0 --logdir cifar100_00 --seed 1339  >stdout/cifar100_00_01 2>&1 &
nohup python linear_eval.py --name mnn --dataset tinyimagenet --gpuid 0 --logdir tinyimagenet_00 --seed 1339  >stdout/tinyimagenet_00_01 2>&1 &

Pre-trained Models

You can download pretrained models here:

  • this link trained on three datasets.
  • Download and place in the "./checkpoints" directory

Results

Our model achieves the following performance:

Image Classification on four datasets

- CIFAR-10 CIFAR-100 Tiny ImageNet
MSF 90.19 59.22 42.68
MNN(Ours) 91.47 67.56 50.70

Contributors and Contact

📋 If there are any questions, feel free to contact with the authors.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%