Code Monkey home page Code Monkey logo

Comments (14)

slothkong avatar slothkong commented on August 11, 2024 2

@OPPOA113 I'm working on it right now. I also want to modify the code to support other DNNs . I think what @yihui-he was talking about can be found in https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1343 and https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1376 . Changing those two "if-conditions" to "False" might be the solution. Ahh, and also https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1373 should be deleted, since now we don't insert any layers into the model. Ill post if I get it working.

from channel-pruning.

slothkong avatar slothkong commented on August 11, 2024 2

@OPPOA113 Nevermind, still trying to figure it out

from channel-pruning.

slothkong avatar slothkong commented on August 11, 2024 1

@OPPOA113 still not working, I did this:
idxs, W2, B2 = self.dictionary_kernel(X_name, None, d_c, convnext, None)
P_shape = [W2.shape[0], W2.shape[1], 1, 1]
self.WPQ[(conv_P, 0)] = W2.reshape(P_shape)
But I get an error because W2 is too big to be reshaped. Im not sure what should I change.

from channel-pruning.

ethanhe42 avatar ethanhe42 commented on August 11, 2024

The code was rewrite once, I need to adapt it to current released code.
actually you can implement it yourself, just delete VH and ITQ in R3 function.
Duplicate of #16

from channel-pruning.

slothkong avatar slothkong commented on August 11, 2024

Thanks!!!

from channel-pruning.

OPPOA113 avatar OPPOA113 commented on August 11, 2024

@slothkong
Hi
Have you successfully changed the code for pruning only?And what should be modify.

from channel-pruning.

slothkong avatar slothkong commented on August 11, 2024

@OPPOA113 , seems like "channel pruning" depends on "channel decomposition" ㅜㅜ. There is a set of additional layer names conv_H, conv_V and conv_P https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1334-L1336

We are not interested in conv_H or conv_V, only conv_P. However, conv_P is introduced in the new model self.WPQ when we execute "channel decomposition" ( calling the function ITQ_decompose() yields the following values: W1, W2, B, W12)

https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1388-L1392

Finally, in "channel pruning", we use conv_P to set self.WPQ

https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1414-L1419

TODO: we have find a way to define W2 without executing ITQ_decompose() .
@yihui-he, if you are reading this, please comment^^

--- EDIT: Or maybe we can simply add:
P_shape = [W2.shape[0], W2.shape[1], 1, 1]
self.WPQ[(conv_P, 0)] = W2.reshape(P_shape)
self.WPQ[(conv_P, 1)] = B2

under the code line : https://github.com/yihui-he/channel-pruning/blob/e8a5fe0b97eaf5de693cc93a9d1024fdf919dab8/lib/net.py#L1407

from channel-pruning.

OPPOA113 avatar OPPOA113 commented on August 11, 2024

@slothkong
thanks,how it was going on ,it work finally? actually, i do not understand the code completely.
if you have finish,please let me know. thank you !! i will follow you work!

from channel-pruning.

zh0ngtian avatar zh0ngtian commented on August 11, 2024

@slothkong Sorry to bother you, would you like to tell me whether you implement it ?

from channel-pruning.

slothkong avatar slothkong commented on August 11, 2024

@YaoZhongtian I was unable to debug it. Seems like I never fully understood how @yihui-he's code worked. So even thought I managed to prune the hold model and write the protobuf file, it's accuracy was awefully bad.

The author told he was going to release some code for this after he was done with preparations for some conference. But I guess this repo is dead now

from channel-pruning.

zh0ngtian avatar zh0ngtian commented on August 11, 2024

@slothkong Thank for your reply. I just started trying to solve it.

from channel-pruning.

Tveek avatar Tveek commented on August 11, 2024

@YaoZhongtian any solution for this?

from channel-pruning.

zh0ngtian avatar zh0ngtian commented on August 11, 2024

@Tveek Actually, I can't understand the code completely. Just waiting for the author to release the code of this part.

from channel-pruning.

bbjy avatar bbjy commented on August 11, 2024

Is there anyone know how the speed-up is determined? And what is the relationship between the speed-up ratio and the corresponding channel preserved ratio?Thank you!

from channel-pruning.

Related Issues (20)

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.