【Neuron Merging】2020-NIPS-Neuron Merging: Compensating for Pruned Neurons-论文阅读
Neuron Merging: Compensating for Pruned Neurons
2020-NIPS-Neuron Merging: Compensating for Pruned Neurons
来源:ChenBong 博客园
- Institute:Korea Institute of Science and Technology 韩国科学技术研究院
- Author:Woojeong Kim、Suhyun Kim∗
- GitHub:https://github.com/friendshipkim/neuron-merging
- Citation:/
Introduction
在剪掉一个卷积核的同时,将被剪掉的卷积核的一部分信息融合到下一层当中,以减少信息损失
可以与任何重要性度量的剪枝方法结合
data-free,无需fine-tune
Motivation
前一层的 卷积核 被移除后,后一层卷积核对应的通道也会被相应移除,导致性能下降,且导致性能下降的误差会逐层累积。
Contribution
- 一种将被剪掉的 neurons/filters 的部分信息融合到下一层,以补偿信息损失的方法
- one-shot,data-free 的 neuron 融合方法,应用了neurons之间的余弦相似度来确定融合到哪个filter
- 融合的模型相比剪枝模型更好地保留了原始模型的信息
Method
Fully Connected Layer
layer \(i\) 的输入 \(x_i∈R^{N_i}\) ,输出 \(x_{i+1}∈R^{N_{i+1}}\)
layer \(i\) 的权重 \(W_i∈R^{N_i×N_{i+1}}\)
\(\mathbf{a}_{i+1}=\mathbf{W}_{i+1}^{\top} f\left(\mathbf{W}_{i}^{\top} \mathbf{x}_{i}\right) \qquad (1)\) ,其中 \(f\) 是激活函数(ReLU)
将 \(W_i∈R^{N_i×N_{i+1}}\) 分解为 \(Y_i∈R^{N_i×P_{i+1}}\) 和 \(Z_i∈R^{P_{i+1}×{N_{i+1}}}\)
\(\mathbf{a}_{i+1} \approx \mathbf{W}_{i+1}^{\top} f\left(\mathbf{Z}_{i}^{\top} \mathbf{Y}_{i}^{\top} \mathbf{x}_{i}\right) \qquad(2)\)
关键在于能否将 \(Z_i^\top\) 与 \(W_{i+1}^\top\) 结合,即将当前层权重 \(W_i\) 的一部分信息融合到下一层的权重 \(W_{i+1}\) 当中,当 \(f\) 时ReLU函数 且 \(Z\) 只含有非负元素时,可以将 \(Z\) 移到 \(f\) 外部:
\(\mathbf{a}_{i+1} \approx \mathbf{W}_{i+1}^{\top} \mathbf{Z}_{i}^{\top} f\left(\mathbf{Y}_{i}^{\top} \mathbf{x}_{i}\right)=\left(\mathbf{Z}_{i} \mathbf{W}_{i+1}\right)^{\top} f\left(\mathbf{Y}_{i}^{\top} \mathbf{x}_{i}\right)=\left(\mathbf{W}_{i+1}^{\prime}\right)^{\top} f\left(\mathbf{Y}_{i}^{\top} \mathbf{x}_{i}\right) \qquad (3)\)
其中 \(\mathbf{W}_{i+1}^{\prime}=\mathbf{Z}_{i} \mathbf{W}_{i+1} \in \mathbb{R}^{P_{i+1} \times N_{i+2}}\)
Convolution Layer
\(\mathcal{A}_{i+1}=\mathcal{W}_{i+1} \otimes f\left(\mathcal{W}_{i} \otimes \mathcal{X}_{i}\right) \qquad (4)\)
$ \mathcal{W}{i} \approx \mathcal{Y} \times_{1} \mathbf{Z}_{i}^{\top} \qquad(5)$ , 其中 \(\mathbf{Z}_{i} \in \mathbb{R}^{P_{i+1} \times N_{i+1}}\) , \(\mathcal{Y}_{i} \in \mathbb{R}^{P_{i+1} \times N_{i} \times K \times K}\)
\(\begin{aligned} \mathcal{A}_{i+1} & \approx \mathcal{W}_{i+1} \otimes f\left(\left(\mathcal{Y}_{i} \times_{1} \mathbf{Z}_{i}^{\top}\right) \otimes \mathcal{X}_{i}\right) \\ &=\mathcal{W}_{i+1} \otimes f\left(\left(\mathcal{Y}_{i} \otimes \mathcal{X}_{i}\right) \times_{1} \mathbf{Z}_{i}^{\top}\right) \end{aligned} \qquad (6a)\)