• Stars
    star
    457
  • Rank 92,713 (Top 2 %)
  • Language
    Jupyter Notebook
  • Created almost 4 years ago
  • Updated almost 2 years ago

Reviews

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

Repository Details

PyTorch implementation of Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning

PyTorch-BYOL

PyTorch implementation of Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning.

Image of Yaktocat

Installation

Clone the repository and run

$ conda env create --name byol --file env.yml
$ conda activate byol
$ python main.py

Config

Before running PyTorch BYOL, make sure you choose the correct running configurations on the config.yaml file.

network:
  name: resnet18 # base encoder. choose one of resnet18 or resnet50
   
  # Specify a folder containing a pre-trained model to fine-tune. If training from scratch, pass None.
  fine_tune_from: 'resnet-18_40-epochs'
   
  # configurations for the projection and prediction heads
  projection_head: 
    mlp_hidden_size: 512 # Original implementation uses 4096
    projection_size: 128 # Original implementation uses 256

data_transforms:
  s: 1
  input_shape: (96,96,3)

trainer:
  batch_size: 64 # Original implementation uses 4096
  m: 0.996 # momentum update
  checkpoint_interval: 5000
  max_epochs: 40 # Original implementation uses 1000
  num_workers: 4 # number of worker for the data loader

optimizer:
  params:
    lr: 0.03
    momentum: 0.9
    weight_decay: 0.0004

Feature Evaluation

We measure the quality of the learned representations by linear separability.

During training, BYOL learns features using the STL10 train+unsupervised set and evaluates in the held-out test set.

Linear Classifier Feature Extractor Architecture Feature dim Projection Head dim Epochs Batch Size STL10 Top 1
Logistic Regression PCA Features - 256 - - 36.0%
KNN PCA Features - 256 - - 31.8%
Logistic Regression (Adam) BYOL (SGD) ResNet-18 512 128 40 64 70.1%
Logistic Regression (Adam) BYOL (SGD) ResNet-18 512 128 80 64 75.2%

More Repositories

1

SimCLR

PyTorch implementation of SimCLR: A Simple Framework for Contrastive Learning of Visual Representations
Jupyter Notebook
2,100
star
2

deeplab_v3

Tensorflow Implementation of the Semantic Segmentation DeepLab_V3 CNN
Jupyter Notebook
804
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