GithubHelp home page GithubHelp logo

incheon-cho / dynamic_model_pruning_with_feedback Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 5.0 224 KB

Implement of Dynamic Model Pruning with Feedback with pytorch

Python 99.63% Shell 0.37%
pruning pytorch-implementation prune pruning-structures

dynamic_model_pruning_with_feedback's Introduction

Dynamic Model Pruning with Feedback

Paper Link : Dynamic Model Pruning with Feedback - ICLR2020

It's UNOFFICIAL code!

If you want to get information of hyperparameters, you should read appendix part of this paper

Abstract

(1) Allowing dynamic allocation of the sparsity pattern

(2) Incorporating feedback signal to reactivate prematurely pruned weights

Method

Alt text

Alt text

Run

python main.py cifar10 --datapath DATAPATH --a resnet layers 56 -C -g 0 save train.pth \
--epochs 300 --batch-size 128  --lr 0.2 --wd 1e-4 --nesterov --scheduler multistep --milestones 150 225 --gamma 0.1

Experiment

Best Top-1 Acc(%) Sparsity(%)
Basline 93.97 0
DPF 93.73 90.00

Experiment on ResNet56 for CIFAR10

DPF run :

python main.py cifar10 --datapath DATAPATH -a resnet --layers 56 -C -g 0 --save prune.pth \
-P --prune-type unstructured --prune-freq 16 --prune-rate 0.9 --prune-imp L2 \
--epochs 300 --batch-size 128  --lr 0.2 --wd 1e-4 --nesterov --scheduler multistep --milestones 150 225 --gamma 0.1

dynamic_model_pruning_with_feedback's People

Contributors

creaitr avatar incheon-cho avatar incheon-cho-95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

dynamic_model_pruning_with_feedback's Issues

TypeError: Conv2d._conv_forward() missing 1 required positional argument: 'bias'

Hi
Running this script cause the error in line 26 mnn.py
"python main.py cifar10 --datapath DATAPATH -a resnet --layers 56 -C -g 0 --save prune.pth -P --prune-type unstructured --prune-freq 16 --prune-rate 0.9 --prune-imp L2 --epochs 10 --batch-size 80 --lr 0.2 --wd 1e-4 --nesterov --scheduler multistep --milestones 150 225 --gamma 0.1"

" Conv2d._conv_forward() missing 1 required positional argument: 'bias'"

AttributeError

Hi
When I run your script, after validation, I encounter with
"AttributeError: 'Namespace' object has no attribute 'ensemble'
How can I resolve it?
Line 305 in main.py

Should the weights be masked at forward() ?

Hi, thank you for sharing your implementation.
I have noticed that the weights are masked out at every forwarding step such as in line 146 in models/resnet.py:
self.conv1.weight.data = torch.mul(self.conv1.weight, self.mask1.weight)

From my understanding of the paper, it seems the weights are not masked out to prevent prematurely pruning weights, which is also reflected in their algorithm in Appendix A.

I see that your implementation closely reproduces their result. Would you kindly give me some intuition on why the weights should be masked at every forward step?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.