Pruning basics and actual combat (5): Detailed explanation of pruning code

To prune the model, we only prune the layer with parameters, we use BatchNorm2d to channel importance γ \gammaγ parameter for dilution training. BatchNorm2d and its front and rear layers also need to be pruned. Mainly for layers with parameters:Conv2d,BatchNorm2d,Linear. But we will not prune the Pool2d layer, because Pool2d is only used for downsampling, there are no learnable parameters, no processing

insert image description here

0 VGG model code

insert image description here

import<

Guess you like

Origin blog.csdn.net/weixin_38346042/article/details/132524857