Giter VIP home page Giter VIP logo

Comments (4)

Eric-mingjie avatar Eric-mingjie commented on May 24, 2024

mask实现并不影响pruning和fine-tuning的过程

from network-slimming.

xjcvip007 avatar xjcvip007 commented on May 24, 2024

感谢你的回答,可能我说的不是很清楚,举个例子,在mask_impl的实现中,假如现在对resnet进行剪枝,先用main_mask进行bn层稀疏化的训练;之后利用prune_mask进行剪枝,这步中剪枝后的模型权重保存了resnet的cfg变量;第三步重新用main_mask对上一步剪枝后的权重进行finetune,由此有三个小问题:
(1)但是我看main_mask.py中并没有用到第二步的cfg变量来对剪枝后模型进行重构(load的时候没有使用cfg变量);
(2)第二步保存的权重中为0的部分并没有进行剪枝吧,还是保存了下来,这样如何在第三步中载入剪枝后的模型呢?
(3)剪枝后其实只是权重置0,最后存储下来的模型权重好像并没有太大变化吧?
期待你的回答,谢谢~

from network-slimming.

Eric-mingjie avatar Eric-mingjie commented on May 24, 2024

(1) 不需要cfg,因为mask的信息包含了cfg
(2) mask模型的意义就在于没有实质的剪枝发生,模型的大小仍然保持一样。只是inference的时候mask模型等价于prune后的模型
(3) 是的

from network-slimming.

zhaoxin111 avatar zhaoxin111 commented on May 24, 2024

这里mask版的实现作者提到能解决整个层被裁剪的问题。若模型中间某整个层被裁剪了,即整个层对应BN层的gamma都被置0,那么在retrain过程中,pruned model应该无法有效收敛呀,因为在被裁整层之前梯度都被截断了,都是0。这块不知道是不是我理解的问题?

from network-slimming.

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.