Pruning models in Pytorch: How to rewind weights?

16 Views Asked by At

Sorry in advance for my question, I'm still fairly new to Deep Learning and Pytorch.

I'm looking for strategies to increase inference speed, and I came upon Pruning. If I understood correctly, this is an iterative process:

  1. Train model
  2. Prune
  3. Set non pruned weights of original model back to the initial weight values (rewinding)
  4. Train again this model
  5. Repeat 2 - 4

Can anyone give an example, or guide me on how to perform these steps, in particular rewinding, in Pytorch?

I also have a second question: How can only setting some weights to 0 increase inference speed without modifying the model architecture itself?

I've been searching around but I can't find examples on how to perform rewinding.

Note that currently I have no minimal code example to share, since I'm still trying to figure out how to do this.

Thank you!

0

There are 0 best solutions below