Comments (4)
Hi,
thanks for reaching out. here is an overview and please feel free to ask me any follow-up questions if you want to go into details about any of those:
The BaseCompressedNet
takes care of the overall compression and provides the high-level API for compressing a network.
The network compression itself is split up into multiple parts:
-
Allocator
: The allocator takes a overall desired prune ratio for the network and allocates a per-layer prune ratio. So in the simplest case the allocator could just be a constant per-layer prune ratio, for example. -
Pruner
: The pruner takes as input the per-layer prune ratio and determines how many weights should be pruned from each filter or neuron in the layer. So it's almost like a allocator within a layer. -
Sparsifier
: this class actually implements the sparsification. So as input it takes the per-neuron/filter sparsity determined by the pruner and sparsifies the weight tensor. -
Tracker
: is a convenient wrapper for pytorch's forward/backward hook functionality to track layer statistics that might be required during pruning.
from torchprune.
Hi,
Thanks for the explanation. I was going through the code with the info you provided above and it helped me get a better understanding of how things works.
I just need a bit more explanation on how base classes for allocator and pruner work. I have hard time to understand the base logic behind these two classes, just by reading the code. Any help will be appreciated.
from torchprune.
Also another question. I'm interested to play around with the structured sparsification of the model. Does the code remove the sparsed filters from the model? I would like to be able to get real performance boost on the hardware, after performing the sparsification.
Thanks,
from torchprune.
This is currently not supported and/or I don't have plans to support it. If you are interested in inference time speed-ups, then I would recommend writing some type of post-processing tool that takes the network graph as input and outputs the slimmed model.
Alternatively, you can also hardcode the slimmed version for a particular architecture.
If you want to implement something like this, I would be happy to take PRs as well.
from torchprune.
Related Issues (11)
- ResNet56 architecture HOT 2
- where is the lib? HOT 3
- BERT support for ALDS pruning.
- What is the code runtime environment?
- Generalization of the Repo HOT 1
- export to onnx HOT 1
- Reproduce the informative features analysis? HOT 2
- codes for reproducing your results HOT 1
- FileNotFoundError: This parameter file does not exist HOT 2
- How to use ALDS in my model
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchprune.