Comments (2)
你好,
-
更新alpha时变动的元素是alpha的grad值大还是值小的元素
论文算法1的10-12行有具体流程,第10行的
TopKMask
代表取累计梯度最大的K个位置生成 0-1 Mask$M^t$ 。$M_t$ 为0代表需要保留的位置,$M_t$ 为1代表需要剪枝的位置,也即累计梯度大的位置需要被剪枝。 -
为何grad比threshold大的部分参数重要性就小以至于能趋于0呢
首先需要区分在Progressive Pruning中会涉及到的两种不同mask。我们不想让需要被剪枝的值从原值直接变为0(这对应我们直接将二值化的
$M^t$ 乘到模型里),而是想让其逐渐变为0,因此这里我们需要把二值化的$M^t$ 平滑成一个连续实值的mask$\zeta^t$ ,也即让$\zeta^t$ 作为真正乘到模型里的mask。所有的mask
$\zeta^t$ 的初值都为1,为促进稀疏化,其范数会被作为额外的损失项,即公式3。如果按正常随机梯度下降更新mask$\zeta^t$ 的参数,那么在不重要的位置上mask$\zeta^t$ 的值学出来会比较小,这也意味着从iteration 0开始他们的累计梯度比较大。由于在Progressive Pruning中我们需要控制在每个iteration时mask$\zeta^t$ 的更新,正常随机梯度下降只能促使mask$\zeta^t$ 值变小,但控制不了每个iteration时mask$\zeta^t$ 的具体取值,所以Progressive Pruning借用了累计梯度作为指标,先根据累计梯度生成0-1 Mask$M^t$ ,再根据$M^t$ 和当前时间步$t$ 平滑成连续实值的mask$\zeta^t$ ,以达到控制每个iteration时mask$\zeta^t$ 具体取值的效果。
from upop.
你好,
- 更新alpha时变动的元素是alpha的grad值大还是值小的元素
论文算法1的10-12行有具体流程,第10行的TopKMask
代表取累计梯度最大的K个位置生成 0-1 Mask Mt 。 Mt 为0代表需要保留的位置, Mt为1代表需要剪枝的位置,也即累计梯度大的位置需要被剪枝。- 为何grad比threshold大的部分参数重要性就小以至于能趋于0呢
首先需要区分在Progressive Pruning中会涉及到的两种不同mask。我们不想让需要被剪枝的值从原值直接变为0(这对应我们直接将二值化的 Mt 乘到模型里),而是想让其逐渐变为0,因此这里我们需要把二值化的 Mt 平滑成一个连续实值的mask ζt,也即让 ζt 作为真正乘到模型里的mask。
所有的mask ζt的初值都为1,为促进稀疏化,其范数会被作为额外的损失项,即公式3。如果按正常随机梯度下降更新mask ζt 的参数,那么在不重要的位置上mask ζt 的值学出来会比较小,这也意味着从iteration 0开始他们的累计梯度比较大。由于在Progressive Pruning中我们需要控制在每个iteration时mask ζt 的更新,正常随机梯度下降只能促使mask ζt 值变小,但控制不了每个iteration时mask ζt 的具体取值,所以Progressive Pruning借用了累计梯度作为指标,先根据累计梯度生成0-1 Mask Mt,再根据 Mt 和当前时间步 t 平滑成连续实值的mask ζt,以达到控制每个iteration时mask ζt 具体取值的效果。
所以我可以理解为应该是M=0代表越重要所以需要保留吗?也就是楼主实际上说错了,楼主以为重要性小才会趋于0.传统掩码剪枝一般是为1保留为0修剪。但是您的工作中是把Mask矩阵看作修剪矩阵,所以1代表修剪0代表不剪,也就是1代表权重不重要0代表重要
from upop.
Related Issues (14)
- Cannot find package petrel-oss-sdk while installing dependencies
- No such file or directory: 'java': 'java' while evaluating or compressing models on the Image Caption task
- Runtime error caused by clip/mock.py or deit/mock.py while evaluating or compressing
- Question about accumulated gradients metric HOT 3
- Problem installing petrel-oss-sdk v2.2.1-2-g1505ef3-master from environment.yaml pip dependencies HOT 1
- Availability of Pretrained Weights for Chinese Users HOT 2
- Problem with CLIP implementation HOT 1
- 请问能否支持blip2模型? HOT 1
- 显存被占满 HOT 1
- 加載checkpoints HOT 9
- 你好,我想询问一些关于微调方面的问题 HOT 7
- 关于数据集的问题 HOT 1
- 您好,想问一下FLOPs指标的问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upop.