• Stars
    star
    217
  • Rank 182,446 (Top 4 %)
  • Language
    Python
  • Created about 5 years ago
  • Updated over 4 years ago

Reviews

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

Repository Details

A large scale study of Knowledge Distillation.

Distiller

alt text

A clean Pytorch implementation to run quick distillation experiments. Our findings are available for reading in our paper "The State of Knowledge Distillation for Classification" linked here.

Python Dependencies

This codebase only supports Python 3.6+.

Required Python packages:

  • torch torchvision tqdm numpy pandas seaborn

All packages can be installed using pip3 install --user -r requirements.txt.

This project is also integerated with Pytorch Lightning. Use the lightning branch to see Pytorch Lightning compatible code.

Run

The benchmarks can be run via python3 evaluate_kd.py and providing the respective command line parameters. For example:

python3 evaluate_kd.py --epochs 200 --teacher resnet18 --student resnet8 --dataset cifar10 --teacher-checkpoint pretrained/resnet18_cifar10_95260_parallel.pth --mode nokd kd

Runs basic student training and knowledge distillation for 200 epochs using a pretrained teacher. There are checkpoints of multiple models in the pretrained folder.

Supported distillation modes

Distillation Technique Mode Description
Baseline Accuracy nokd Plain training with no knowledge distillation.
Baseline Knowledge Distillation Accuracy kd Hinton loss to distill a student network.
Ensemble of Teachers allkd Distill from a list of teacher models and pick the best performing one.
Hyper parameter tuning of Hinton Loss kdparam Distill using varying combinations of temperature and alpha and pick the best performing combination.
Triplet Loss triplet Knowledge Distillation with a triplet loss using the student as negative example.
Ensemble of Students multikd Train a student under an ensemble of students that are picked from a list.
Unsupervised Data Augmentation Loss uda Run knowledge distillation in combination with unsupervised data augmentation.
Teacher Assistant Knowledge Distillation takd Run distillation using Teacher-Assistant distillation.
Activation Boundary Distillation ab Run feature distillation using Activation-Boundary distillation.
Overhaul Distillation oh Run feature distillation using the Feature Overhaul distillation.
Relational Knowledge Distillation rkd Run distillation using the Relational Knowledge distillation.
Patient Knowledge Distillation pkd Run feature distillation using the Patient Knowledge distillation.
Simple Knowledge Distillation sfd Runs a custom feature distillation distillation (Simple Feature Distillation) that just pools and flattens feature layers.

Results

alt text

alt text

More Repositories

1

DoodleMaster

"Don't code your UI, Draw it !"
JavaScript
2,427
star
2

SaliencyMapper

Pytorch implementation of Real Time Image Saliency for Black Box Classifiers https://arxiv.org/abs/1705.07857
Python
57
star
3

buildTensorflow

A lightweight deep learning framework made with ❀️
C++
32
star
4

papers

Notes on the papers I've read on deep learning. Contributions welcome !
27
star
5

Torrent-Hunter

A chrome extension that downloads torrents from under a barrage of advertisements and spam
JavaScript
15
star
6

Chatagram

Winning ChatBot in the IBM ChatBot competition. A ChatBot for a bank
Python
14
star
7

object-detection

Software which implements state of the art object detectors
Python
9
star
8

phoneFinder

A small Mask RCNN prototype that learn to detect a phone in an image
Python
7
star
9

A-Small-Little-Game

Made in Java.Coded with Love
Java
7
star
10

AK-Auditer

The Aditya Karan Auditer. This is a logging/auditing tool which periodically logs system information and storage info(USB's etc) .It send it to the server. A robust user interface allows us to see what external communication has happened at a specific date to all the PC's connected to the LAN network. Coded using C++,C#,PHP,HTML and CSS
7
star
11

dynamo-simulator

An implementation of Dynamo Key Value Store in Python. One of my favorite projects !
Python
5
star
12

SmartDoctor

A web app to self diagnose illnesses and perform your daily health check. Winning project of the Practo Sandbox Hackathon
JavaScript
4
star
13

nlpStuff

My learning how to use NLP effectively in Python
HTML
3
star
14

3D-Graphics-Engine

This is a 3-D graphics engine made for my stupid no good graphics practical.
C++
3
star
15

professional-app

A starter pack for the modern application building experience
JavaScript
3
star
16

sim2real

A list of RL algorithms that implement sim2real algorithms
Python
3
star
17

GroupChatSockets

A group chat made in c# using sockets
C#
2
star
18

malloc

A study on memory allocators in C++
C++
2
star
19

objectdetection-

A NYU Computer Vision Assignment (nΓΊmero dos)
Jupyter Notebook
2
star
20

dqn

DQN implementation
Python
2
star
21

Hackathon

A Nodejs project for the NSIT hackathon
JavaScript
1
star
22

MovieBrowser

An angular application to search movies on the go.Extremely fast.
HTML
1
star
23

traffic-sign-detection-homework

Python
1
star
24

NeuralNet

A Neural Network Coded From Scratch
Python
1
star
25

agile-gitpractice

1
star
26

pytorch-rnet

An RNET implementation for question answering in PyTorch . https://www.microsoft.com/en-us/research/publication/mrc/
Python
1
star
27

karanbot

http://18.218.120.175:5000
JavaScript
1
star
28

SpeechMarker

This project intends to build an efficient speech to text image water marking python application.
Python
1
star
29

play-with-vcr

Playing Around with Visual Commonsense Reasoning
Python
1
star
30

mpi

MPI Practice
C++
1
star
31

ssl

A framework for self supervised learning
Python
1
star