Skip to content

Commit 401e9ff

Browse files
committed
add readme
1 parent 7c4f225 commit 401e9ff

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

.DS_Store

-6 KB
Binary file not shown.

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Weights Pruning PyTorch Implementation
2+
3+
Luyu Wang & Gavin Ding, Borealis AI
4+
5+
----
6+
## Weights pruning
7+
Han et al propose to compress deep learning models via weights pruning [Han et al, NIPS 2015](http://papers.nips.cc/paper/5784-learning-both-weights-and-connections-for-efficient-neural-network). This repo is an implementation in PyTorch. The pruning method is replaced by the "class-blinded" method mentioned in [See et al, CoNLL 2016](https://arxiv.org/abs/1606.09274), which is much easier to implement and has better performance as well.
8+
9+
----
10+
## High-level idea
11+
1. We write wrappers on PyTorch Linear and Conv2d layers
12+
2. For each layer, once a binary mask tensor is computed, it is multiplied with the actual weights tensor on the forward pass
13+
3. Multiplying the mask is a differentiable operation and the backward pass is handed by automatic differentiation (no explicit code here)
14+
15+
----
16+
## Notes
17+
This implementation is not aiming at obtaining computational efficiency but to offer convenience for studying properties of pruned networks. Discussions on how to have an efficient implementation is welcome. Thanks!

0 commit comments

Comments
 (0)