rethinking-network-pruning
rethinking-network-pruning copied to clipboard
Pruning steps
If I want to prune VGG model using l1 norm pruning method and CIFAR dataset I have to run: 1- main.py 2-Vggprune.py 3-main_finetune.py Because when i start with Vggprune.py I obtained a test accuracy with 10% of the model and the same test acuuracy of the newmodel (pruned model).
Also, I don't undestand this line: out_channels = m.weight.data.shape[0] And why the choice of : start_mask = torch.ones(3) , is it because the in_channels are 3 ??
I don't quite understand the first question. Are you asking why the test accuracy of pruned model is small? Maybe the model is pruned too much.
out_channels
is just the number of filters in the convolutional layer with kernel weight m
. start_mask=torch.ones(3)
is just to initialize the mask with the first convolution layer that has 3 input channels.
For the first question, I meant that if I try to run your code to prune VGG model using l1 norm pruning method and CIFAR dataset I should at first run main.py to obtain the accuracy of the model before pruning then I run Vggprune.py for the pruning and lastly to retrain the pruned model I run main_finetune.py.
I should at first run main.py to obtain the accuracy of the model before pruning then I run Vggprune.py for the pruning and lastly to retrain the pruned model I run main_finetune.py.
That is correct.