nni icon indicating copy to clipboard operation
nni copied to clipboard

Iterative soft pruning

Open gkrisp98 opened this issue 1 year ago • 0 comments

Hi, I want to apply iterative soft pruning to an object detector using FPGM pruner from NNI. This means that I want to follow this procedure: -prune the net -train it but with allowing the pruned filters to regain some weight -prune -start again

I wanted to ask : Does using the following code mess up with the models gradients? Because I am observing that although I train the model again after I unwrap it, the model's sparsity remains the same.

pruner = FPGM(net, congif_list)
pruner.compress()
pruner._unwrap_model()

And if it does zero out the gradients, is there a way to modify that to allow pruned weights to receive gradient updates?

gkrisp98 avatar Sep 08 '23 12:09 gkrisp98