Git Product home page Git Product logo

teacher-student-network's Introduction

Teacher-Student-Network

Pytorch implementation of Teacher-Student Network which idea of model compression by teaching a smaller network, step by step, exactly what to do using a bigger already trained network. While large teacher model have higher knowledge capacity than small student model, this capacity might not be fully utilized. It can be computationally just as expensive to evaluate a model even if it utilizes little of its knowledge capacity. Knowledge distillation transfers knowledge from a large model to a smaller model without loss of validity. Teacher supervising the student's learning helps in achieving a better score metric than it was able to achieve when the student network tried learning in a supervised way.

Dataset Information

The Student and teacher were trained on CIFAR100 and CIFAR10 dataset. The dataset contains 50k train images containing 100, 10 classes respectively

Usage

  1. Install all the libraries required pip install -r requirements .
  2. Run python3 train.py .
  3. For inference run python3 predict.py .

Results

  1. CIFAR 100
Method Accuracy
Teacher Model 54.3%
Student Model 28.3%
Teacher-Student Model 33.1%
  1. CIFAR 10
Method Accuracy
Teacher Model 87.3%
Student Model 66.4
Teacher-Student Model 73.1%

Extra Info

1) Trainin Stratergy       : Teacher was trained first, and later used, to supervise the student's training
2) Optimizer               : Adam optimizer was used with weight decay.
3) Learning Rate Scheduler : Linear decay scheduler.
4) Teacher Loss            : Cross-Entropy Loss.
5) Texcher-Student Loss    : Mixture of Cross-Entropy Loss and KL Divergence
5) Regularization          : Weight Decay, Dropout, Image Augmentation
6) Performance Metric      : Accuracy.
7) Epochs Trained          : 100
9) Training Time           : 52 minutes.

teacher-student-network's People

Contributors

panic341 avatar shivamrajsharma avatar

Stargazers

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

Watchers

 avatar  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.