• Stars
    star
    2,100
  • Rank 21,207 (Top 0.5 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations

PyTorch SimCLR: A Simple Framework for Contrastive Learning of Visual Representations

DOI

Blog post with full documentation: Exploring SimCLR: A Simple Framework for Contrastive Learning of Visual Representations

Image of SimCLR Arch

See also PyTorch Implementation for BYOL - Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning.

Installation

$ conda env create --name simclr --file env.yml
$ conda activate simclr
$ python run.py

Config file

Before running SimCLR, make sure you choose the correct running configurations. You can change the running configurations by passing keyword arguments to the run.py file.

$ python run.py -data ./datasets --dataset-name stl10 --log-every-n-steps 100 --epochs 100 

If you want to run it on CPU (for debugging purposes) use the --disable-cuda option.

For 16-bit precision GPU training, there NO need to to install NVIDIA apex. Just use the --fp16_precision flag and this implementation will use Pytorch built in AMP training.

Feature Evaluation

Feature evaluation is done using a linear model protocol.

First, we learned features using SimCLR on the STL10 unsupervised set. Then, we train a linear classifier on top of the frozen features from SimCLR. The linear model is trained on features extracted from the STL10 train set and evaluated on the STL10 test set.

Check the Open In Colab notebook for reproducibility.

Note that SimCLR benefits from longer training.

Linear Classification Dataset Feature Extractor Architecture Feature dimensionality Projection Head dimensionality Epochs Top1 %
Logistic Regression (Adam) STL10 SimCLR ResNet-18 512 128 100 74.45
Logistic Regression (Adam) CIFAR10 SimCLR ResNet-18 512 128 100 69.82
Logistic Regression (Adam) STL10 SimCLR ResNet-50 2048 128 50 70.075

More Repositories

1

deeplab_v3

Tensorflow Implementation of the Semantic Segmentation DeepLab_V3 CNN
Jupyter Notebook
804
star
2

PyTorch-BYOL

PyTorch implementation of Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning
Jupyter Notebook
457
star
3

blog-resources

This repo will contain the resources available in my blog for learning
Jupyter Notebook
92
star
4

face-similarity

Face-similarity CNN using Tensorflow Eager execution.
Python
70
star
5

SimCLR-tensorflow

TensorFlow Implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations
Python
23
star
6

cnn_denoiser

Jupyter Notebook
19
star
7

tensorflow2.0-papis-workshop

Jupyter Notebook
9
star
8

dense-net

Tensorflow implementation of Densely Connected Convolutional Networks - DenseNet
Python
9
star
9

fishers-linear-discriminant

Implementation of Fisher's Linear Discriminant (LDA)
Jupyter Notebook
9
star
10

sthalles.github.io

SCSS
7
star
11

logistic-regression

Jupyter Notebook
5
star
12

CLoVE

Official PyTroch implementation for Self-supervised Learning of Contextualized Local Visual Embeddings (CLoVE)
Python
5
star
13

carp

Official PyTorch implementation of Representation Learning via Consistent Assignment of Views over Random Partitions (CARP)
Python
4
star
14

PIRL

TensorFlow implementation of Self-Supervised Learning of Pretext-Invariant Representations - PIRL
Jupyter Notebook
4
star
15

computer-vision

Jupyter Notebook
3
star
16

aerial-image-segmentation

Python
2
star
17

vision-transformer

PyTorch Vision Transformer Implementation
Python
1
star
18

asynchronous-advantage-actor-critic

Python
1
star
19

tensorflow-tutorials

Tensorflow Colab Notebooks used for training.
Jupyter Notebook
1
star
20

xor-lstm

Build an LSTM model for learning the XOR function.
Jupyter Notebook
1
star
21

resume

my resumes
TeX
1
star
22

MaSSL

Official PyTroch implementation for *Learning from Memory: A Non-Parametric Memory Augmented Self-Supervised Learning of Visual Features*
1
star