Giter VIP home page Giter VIP logo

lrp_pruning's Introduction

LRP based Structured Pruning

Requirements

Pytorch 1.6.0+
Python 3.8+
pandas

Model

ResNet-18, ResNet-50
VGG-16, AlexNet

Toy Experiment

https://github.com/seulkiyeom/LRP_Pruning_toy_example

Reference

If you make use of, or are inspired by our work and code, please cite our paper

@article{yeom2021pruning,
  title={Pruning by explaining: A novel criterion for deep neural network pruning},
  author={Yeom, Seul-Ki and
          Seegerer, Philipp and
          Lapuschkin, Sebastian and
          Binder, Alexander and
          Wiedemann, Simon and
          M{\"u}ller, Klaus-Robert and
          Samek, Wojciech},
  journal={Pattern Recognition},
  pages={107899},
  year={2021},
  publisher={Elsevier}
}


lrp_pruning's People

Contributors

seulkiyeom avatar

Stargazers

 avatar  avatar Karolina-Bogacka avatar Anicet Hounkanrin avatar  avatar Xiaotian Guo avatar Lorenz avatar Lukas Hedegaard avatar Ferdinand Mom avatar rotorliu avatar Mehrdad Moradi avatar Joerg avatar lizhen avatar Joe Lorentz avatar

Watchers

James Cloos avatar  avatar

lrp_pruning's Issues

Possible Conv3D extension plans or tips?

Hi! I was wandering if you could offer some tips on how to extend your code so that Conv3d works for LRP as well.

Could you please suggest which methods/wrappers should be implemented (should I simply make a wrapper similar to conv2d_beta0_wrapper_fct?), or perhaps you already have a prototype Conv3d solution lying around somewhere? The code here is nicely commented, but it is still kinda tough to navigate without much comments

Sorry for any inconvenience, and thanks!

Unfinished Project

Seul
Thanks for your contributions.
I'm beginner on explaining dnn. it seems that your project for dnn pruning is now unfinished , and it can't reproduce the paper's result.
here is my findings

missing dataset for scene 15, event 8 ...
missing transferred model saving switch
failed argparse for args.relevance, args.resume....
a raised problem , missing self.lrp()

mismatched shape in designing resnet18, here s the code

        out = F.relu(self.bn1(self.conv1(x)))
        out = self.layer1(out)
        out = self.layer2(out)
        out = self.layer3(out)
        out = self.layer4(out)
        out = F.avg_pool2d(out, 4)
        out = out.view(out.size(0), -1)
        out = self.linear(out)

compared to common resnet18,

  1. it s lack of maxpool that should apply to the out1
  2. the shape of tensor before flatten layer is 25088 , not 512 required, and the avgpool should avg to (1*1)

missing figure printer for result analysis for acc ...
missing pruning for a limited number of samples without fine-tuning. The original code prunes model using the entire training set.
missing dense layer pruning. orginal code works by pruning the conv layer

i have fixed some basical problem . hope this page gives some advice for others
it helps a lot if you provide after work.

About the VGG16

Hi Seul-Ki,

Thank you for your great work!

When I ran your code, I faced this bug, when you have time, can you have a look?

"prune_vgg.py", line 407, in prune
R_tot, data_tot, time_tot = self.lrp() # lrp using conventional model
AttributeError: 'PruningFineTuner' object has no attribute 'lrp'

Thanks a lot!

Release model weights for reproducibility

I have been unable to replicate your results from table 3 in your paper, are you willing to supply the weights of the models prior to pruning

also could you supply the version of pytorch/torchvision you had used originally

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.