Giter Site home page Giter Site logo

peternara / hcl-contrastive-learning-with-hard-negative-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from joshr17/hcl

0.0 1.0 0.0 19.81 MB

ICLR 2021, Contrastive Learning with Hard Negative Samples

License: MIT License

Shell 0.63% Python 99.37%

hcl-contrastive-learning-with-hard-negative-samples's Introduction

Contrastive Learning with Hard Negative Samples

We consider the question: how can you sample good negative examples for contrastive learning? We argue that, as with metric learning, learning contrastive representations benefits from hard negative samples (i.e., points that are difficult to distinguish from an anchor point). The key challenge toward using hard negatives is that contrastive methods must remain unsupervised, making it infeasible to adopt existing negative sampling strategies that use label information. In response, we develop a new class of unsupervised methods for selecting hard negative samples where the user can control the amount of hardness. A limiting case of this sampling results in a representation that tightly clusters each class, and pushes different classes as far apart as possible. The proposed method improves downstream performance across multiple modalities, requires only few additional lines of code to implement, and introduces no computational overhead.

Contrastive Learning with Hard Negative Samples [paper]
Joshua Robinson, Ching-Yao Chuang, Suvrit Sra, and Stefanie Jegelka

Citation

If you find this repo useful for your research, please consider citing the paper

@article{robinson2020hard,
  title={Contrastive Learning with Hard Negative Samples},
  author={Robinson, Joshua and Chuang, Ching-Yao, and Sra, Suvrit and Jegelka, Stefanie},
  journal={International Conference on Learning Representations},
  year={2021}
}

For any questions, please contact Josh Robinson ([email protected]).

Acknowledgements

Part of this code is inspired by leftthomas/SimCLR, by chingyaoc/DCL, and by fanyun-sun/InfoGraph.

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.