izackwu / CriticalPathPruning

Start from Interpret Neural Networks by Identifying Critical Data Routing Paths

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CriticalPathPruning

How to Run Our Code

We implement our pruning algorithm based on the TensorFlow 1.4.1 with CUDA 8.0. We use CIFAR-100 dataset and VGG-16 network for all the experiments. Codes are available at Github Link

Prerequisite

To run our code, you have to download:

And you need to install following python pachages:

  • pickle
  • json
  • keras
  • numpy
  • tensorflow
  • sklearn

We suggest you to install Anaconda for convenience

Run the Code

Therre are several steps to run the code:

  1. run.py: this file generate class encodes. You should change classes or set loops to run all classes in this file
  2. trim_and_test.py: this file trim the model and test the accuracy with pruned model which has not been fine tuned yet. Change target_class_id for models of different classes
  3. run_finetune.py: this file fine tune the pruned model and test the accuracy with fine tuned models. You should change target_class_id for models of different classes

Notice: we use GPU for training, so you should designate certain GPU for training in these files.

About

Start from Interpret Neural Networks by Identifying Critical Data Routing Paths


Languages

Language:Python 100.0%