I have read the 2019 CVPR paper:RePr: Improved Training of Convolutional Filters and want to implement its method. First, we need to train a CNN several iterations. Then we can use a metric algorithm to rank all filters and drop the 30% least important filters to continue to train a few iterations just like pruning. After that, re-initialize the filters  that are dropped before and continue to train the networks. We modify the training process by cyclically removing redundant ﬁlters, retraining the network, re-initializing the removed ﬁlters, and repeating.
In my opinion, drop the filter  is not really removing it. It just make the weight of that filters don’t work and don’t update. I want to achieve this goal by resetting the weight of dropped filters to 0. For example, I want drop the 23rd filter in first layer,
params = list(model.named_parameters()) params[0][1][22] = 0
But it has an error when loss.backward():RuntimeError:leaf variable has been moved into graph interior.
Does anyone know an official method or some other methods to drop specific filters in some layers? Thanks very much!