Git Product home page Git Product logo

earlyexitnet's Introduction

LEENet: Learning Optimal Early Exit Policy for Efficiency Improvements in DNNs

Well-trained deep neural networks (DNNs) treat all test samples equally during prediction. Adaptive DNN inference with early exiting leverages the observation that some test examples can be easier to predict than others. This repository presents LEENet, a brand-new approach to early exit neural DNN models. Instead of traditional early exit networks where gate thesholds are either hardcoded or learned via inference budget thresholds, LEENet learns to optimize a cost/accuracy tradeoff balance based on a single alpha hyperparameter set by the user. This allows the model to choose an appropriate risk level for certain images which the model is less confident at earlier exit indices. Initial experiments are being conducted via DenseNet121, ResNet50, and VGG11 networks for computer vision tasks (ImageNetTE, CIFAR-10, CIFAR-100). Our initial results demonstrate that by solely tuning alpha, LEENet networks can vastly outperform traditional DNNs and also outperforms other early exit techniques in certain circumstances.

Setup

Any python version above 3.8 will suffice for this project. If this is a CUDA-enabled PC, install your latest version of CUDA software and the appropriate PyTorch software. All other packages are in the requirements.txt file linked in the repository.

Usage

All appropriate model architectures are either hardcoded in this repository, or are downloaded via public channels. Pretrained transfer learning models can be found here. Any model not in this list is already trained on the proper dataset and does not require an initial .pth file.

Train a multi-exit model:

This is currently a multi-step process. Please begin by training the classifiers via main.ipynb, then train the appropriate alpha configurations as desired via alpha_tuning.ipynb.

earlyexitnet's People

Contributors

dmace2 avatar austin-chemelli avatar blakesanie avatar afxwong 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.