Accelerating deep convolutional networks using low-precision and sparsity

(这篇blog不涉及文中所探讨的dLAC设计的内容)

这篇文章旨在不影响其准确率的情况下提高deep CNN的计算效率。作者采用了两种方法:1.使用2-bit代替原来的full precision进行训练和inference;2.跳过过于zero value的计算。

1 low-precision deep CNN

作者使用了先前研究者提出的ternary network的框架,使用2-bit来训练整个网络。具体的实现如下

同时,不同于DeepCompression中提到的剪枝,该网络会利用网络中动态的sparsity来skip关于zero value的计算。

1.1 评估模型

文章选用基于Cifar-10训练的VGG模型和基于Imagenet训练的Resnet模型进行评估。

1.2 低精度网络训练

训练低精度网络文章才去一下几种策略:

1.2.1 从全精度网络中获取权值初始值

在训练的前15个周期,使用full-precision的网络进行训练;在之后的周期中切换到low-precision的网络中。这个策略提高了2%的正确率。

1.2.2 低精度部分化

在网络的第一层不使用low-precision的策略,确保输入信息损失的最小化。这一策略提升了Top-1 0.5%的准确率。

1.2.3 大幅降低learning rate

当训练的error rate迟迟不降低的时候,选择大幅降低learning rate进行调节。这一策略提升了Top-1大约1%的准确率。

1.2.4 正则化和ReLU threshold

使用正则化并且调节ReLU的阈值来提升sparsity的占比和降低噪声的影响。

1.3 低精度网络中的sparsity

zero value主要有两个来源,一个是ReLU function阈值之前的值会变为0;另一个是在低精度操作之后一些比较小的权值会变成0.经过统计在inference(forward pass)阶段有74%是有zero value的计算;而在backward pass中有67%是有zero value的计算。

2 results

2.1 Cifar-10 accuracy

baseline的低精度网络降低了大约3%左右的accuracy。为了提高accuracy,做了一些列的步骤:1.Reg series:使用了11中不同的正则化的方式;2.GradUpdate series:跳过classification结果正确的batch的backpropagation来降低overfitting;3.RuluT series:将ReLU的threshold在最后几个epoch中调节为0.01来降低噪声的干扰;4.SkipLayer series:第一层使用full precision。

以上这些手段将accuracy提升了大约1.6%。

2.2 ImageNet accuracy

文章中指出,Resnet的accuracy随着层数的增多越来越好。其中,低精度的Resnet-34/Resnet-50/Resnet-152比全精度的Resnet-18/Resnet-34/Resnet-50的accuracy要高。

加速基于相似性模型匹配的On-The-Fly相似性保持哈希 摘要: 在软件工程中,模型匹配是一项核心任务,广泛应用于模型驱动工程、软件重构、需求管理、代码检查等领域。由于模型通常包含大量的元素和复杂的结构,模型匹配问题变得越来越具有挑战性。相似性匹配是一种流行的模型匹配方法,它通过计算语义相似度来匹配模型元素。然而,由于相似性匹配算法的计算复杂度很高,导致它们的效率低下。 为了提高相似性匹配的效率,我们提出了一种基于On-The-Fly相似性保持哈希的加速方法。该方法利用哈希表将元素映射到桶中,并在桶中使用相似性保持哈希函数计算相似性,从而避免了在匹配过程中进行昂贵的相似性计算。此外,我们还提出了一种基于哈希冲突的剪枝策略,以进一步提高匹配效率。 我们在多个数据集上进行了实验,并与现有相似性匹配算法进行了比较。实验结果表明,我们的方法可以显著提高匹配效率,同时保持高精度。 关键词:模型匹配,相似性匹配,哈希,剪枝 Abstract: In software engineering, model matching is a core task widely applied in model-driven engineering, software refactoring, requirement management, code inspection, etc. Due to the fact that models usually contain a large number of elements and complex structures, model matching problems become increasingly challenging. Similarity-based matching is a popular model matching approach that matches model elements by computing semantic similarities. However, due to the high computational complexity of similarity-based matching algorithms, they suffer from poor efficiency. To improve the efficiency of similarity-based matching, we propose an acceleration method based on On-The-Fly similarity preserving hashing. This method uses a hash table to map elements to buckets and employs similarity preserving hash functions to compute similarities within buckets, thus avoiding expensive similarity computations during the matching process. In addition, we propose a hash conflict-based pruning strategy to further improve the matching efficiency. We conduct experiments on multiple datasets and compare our method with existing similarity-based matching algorithms. Experimental results show that our method can significantly improve the matching efficiency while maintaining high accuracy. Keywords: Model matching, similarity-based matching, hashing, pruning.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值