Code Monkey home page Code Monkey logo

hcl's Introduction

This repo contains the pytorch implementation of the paper: Hyperbolic Contrastive Learning for Visual Representations beyond Objects (CVPR 2023).

Preparation

Command for creating and activating conda enviroment.

conda env create -f environment_hcl.yml
conda activate hcl

Dataset Download

The openimages dataset can be downloaded from this github repo https://github.com/shlokk/object-cropping-ssl.

Pre-Training

python main_hcl.py -a resnet50 --lr 0.15 --batch-size 128 --c 0.05 \
                               --dist-url 'tcp://localhost:10024' --world-size 1 --rank 0 --moco-dim 128 \
                               -j 8 --moco-t 0.2 --mlp --aug-plus --cos --save_name run_v5_cpcp_moco1_hyperbolic0.1_coupled_random_boxes_dim128 \
                               --save_dir . --multiprocessing-distributed --dataset-type hierarchy_diff_crop --theta-moco 1 --theta-hyperbolic 0.1 \
                               --DATAPATH  'path to all_images' 

Linear Probing

Lincls script:
python main_lincls.py \
  -a resnet50 \
  --lr 30.0 \
  --batch-size 256 \
  --pretrained [your checkpoint path]/checkpoint_0199.pth.tar \
  --dist-url 'tcp://localhost:10001' --multiprocessing-distributed --world-size 1 --rank 0 \
  [your imagenet-folder with train and val folders]

Pre-trained models.

Our pre-trained models can be found at https://drive.google.com/drive/folders/1WIFw6dl5OrwCpfj6Q-PqXOc_4Mrv1BTZ.

BibTeX

@article{Ge2022HyperbolicCL,
  title={Hyperbolic Contrastive Learning for Visual Representations beyond Objects},
  author={Songwei Ge and Shlok Kumar Mishra and Simon Kornblith and Chun-Liang Li and David Jacobs},
  journal={ArXiv},
  year={2022},
  volume={abs/2212.00653}
}

@article{
mishra2022objectaware,
title={Object-aware Cropping for Self-Supervised Learning},
author={Shlok Kumar Mishra and Anshul Shah and Ankan Bansal and Janit K Anjaria and Abhyuday Narayan Jagannatha and Abhishek Sharma and David Jacobs and Dilip Krishnan},
journal={Transactions on Machine Learning Research},
year={2022},
url={https://openreview.net/forum?id=WXgJN7A69g},
note={}
}

hcl's People

Contributors

shlokk avatar songweige avatar

Stargazers

Chengyao Xie 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.