Code Monkey home page Code Monkey logo

simsiam-cifar10's Introduction

A minimal PyTorch example of training SimSiam on CIFAR10 with a kNN predictor to report the accuracy after each epoch. The code uses lightlys version of SimSiam.

Final test set accuracy is 91% which is similar to the original paper.

Installation

pip install requirements.txt

Dependencies

This code uses SimSiam provided by lightly. We use PyTorch Lightning for the training loop. There is another example of using SimSiam with lighlty and plain PyTorch here.

Train SimSiam on CIFAR10

Training on a V100 GPU takes around 8 hours for 800 epochs and reaches around 91% accuracy on the test set.

You can run training using the following command:

python main.py

The main.py script is kept very simple. You can modify common parameters such as number of epochs, batch size, number of workers etc.

The default values are:

  • num_workers = 8
  • max_epochs = 800
  • knn_k = 200
  • knn_t = 0.1
  • classes = 10
  • batch_size = 512
  • seed=1

Here are the tensorboard plots: Plot showing accuracy and loss of SimSiam on cifar10

You can access the tensorboard logs using

tensorboard --logdir lightning_logs/

simsiam-cifar10's People

Contributors

igorsusmelj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

simsiam-cifar10's Issues

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.