Home

Awesome

NTK-SAP: Improving neural network pruning by aligning training dynamics

Yite Wang, Dawei Li, Ruoyu Sun

In ICLR 2023.

Overview

This is the PyTorch implementation of NTK-SAP: Improving neural network pruning by aligning training dynamics.

Installation

To run our code, then install all dependencies

pip install -r requirements.txt

Running

Below is a description of the major sections of the code base. Run python main.py --help for a complete description of flags and hyperparameters.

1. Prepare the datasets

MNIST, CIFAR-10, CIFAR-100, Tiny ImageNet will be downloaded automatically. For ImageNet experiment, please download it to Data/imagenet_raw/, or change corresponding path in Utils/load.py.

2. Run foresight pruning experiments

Note experiments of ImageNet requires running code to prune and train separately, see the argument experiment. For other experiments, models will be trained right after pruning. We include a few important arguments:

A sample script can be found in scripts/run.sh.

Acknowledgement

Our code is developed based on the Synflow code: https://github.com/ganguli-lab/Synaptic-Flow.