Giter VIP home page Giter VIP logo

dbpcl's Introduction

Density-Based Prototypical Contrastive Learning on Visual Representations

Requirements

  • PyTorch
  • Pytorch-Lightning
  • scikit-learn

Create Environment

  • conda env create -n <env_name> environment.yml
  • conda activate <env_name>

Self-supervised Training

Our code only supports single-gpu and single-machine training currently.

To perform self-supervised training of a ResNet-32 model on CIFAR-100, run:

python main.py --epochs 200 --dataset cifar100 -a resnet32 --mlp-dim 256 --out-dim 128 -b 64 -t 0.1 --con 0.1 --eps 0.3 0.5 --exp-dir logs --exp-name DBPCL_cifar100_res32_bs64_eps35_round1 --seed 1 --warmup-epoch 0 [dataset folder]

Evaluation

run python eval_cli.py --help for details.

Linear Evaluation

python eval_cli.py --method lr --bs 32 --cuda 0 --j 0 --model-path [model checkpoint file] --data-folder [dataset folder] --dataset [dataset]

Finetune

python eval_cli.py --method ann --bs 32 --cuda 0 --j 4 --model-path [model checkpoint file] --data-folder [dataset folder] --dataset [dataset] --finetune

Download Pretrained Models

pretrain dataset epochs backbone link
CIFAR-10 200 ResNet-32 download
CIFAR-100 200 ResNet-32 download
STL-10 200 ResNet-32 download
Tiny-ImageNet 200 ResNet-32 download

dbpcl's People

Contributors

yuehlinchung avatar

Stargazers

 avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.