Source Code for "Zero Time Waste: Recycling Predictions in Early Exit Neural Networks"
Paper link: https://arxiv.org/pdf/2106.05409.pdf
The repository is split into two parts: supervised learning experiments (directory ztw
) and reinforcement learning
experiments (directory ztw_rl
). The supervised learning code is based on
the code from
the Shallow-Deep-Networks paper.
To run the experiments:
- Preferably, install a conda environment with Python 3.8:
conda create -n ztw_env python=3.8 swig=4.0.2
. - Activate the environment with
conda activate ztw_env
. - Install the dependencies from the
requirements.txt
file into your python environment withpip install -r requirements.txt
. - Set up a neptune.ai account and create a project.
- Set the
NEPTUNE_PROJECT
andNEPTUNE_API_TOKEN
environment variables. - Optionally fetch the TinyImageNet dataset. (Note, however, that the original link to that dataset is not valid anymore.)
- To run the supervised learning experiments, cd into the
ztw
directory and execute the./experiments/std_dev.sh
script. - To run the reinforcement learning experiments, cd into the
ztw_rl
directory and execute the./scripts/run_all.sh
script. - To generate the plots use the notebooks from the
ztw/notebooks
andztw_rl/notebooks
directories.