Skip to main content
QUICK REVIEW

[论文解读] Accurate and Efficient Hyperbolic Tangent Activation Function on FPGA using the DCT Interpolation Filter

Ahmed M. Abdelsalam, J. M. Pierre Langlois|arXiv (Cornell University)|Sep 25, 2016
Model Reduction and Neural Networks参考文献 5被引用 5
一句话总结

本文提出了一种适用于基于FPGA的深度神经网络的高精度、低资源消耗双曲正切激活函数近似方法,采用离散余弦变换插值滤波器(DCTIF)。该方法在仅带来极小面积和延迟开销的情况下,将精度提升至先前工作的100倍,同时保持与精确函数相当的DNN训练和测试性能。

ABSTRACT

Implementing an accurate and fast activation function with low cost is a crucial aspect to the implementation of Deep Neural Networks (DNNs) on FPGAs. We propose a high-accuracy approximation approach for the hyperbolic tangent activation function of artificial neurons in DNNs. It is based on the Discrete Cosine Transform Interpolation Filter (DCTIF). The proposed architecture combines simple arithmetic operations on stored samples of the hyperbolic tangent function and on input data. The proposed DCTIF implementation achieves two orders of magnitude greater precision than previous work while using the same or fewer computational resources. Various combinations of DCTIF parameters can be chosen to tradeoff the accuracy and complexity of the hyperbolic tangent function. In one case, the proposed architecture approximates the hyperbolic tangent activation function with 10E-5 maximum error while requiring only 1.52 Kbits memory and 57 LUTs of a Virtex-7 FPGA. We also discuss how the activation function accuracy affects the performance of DNNs in terms of their training and testing accuracies. We show that a high accuracy approximation can be necessary in order to maintain the same DNN training and testing performances realized by the exact function.

研究动机与目标

  • 解决在基于FPGA的DNN加速器中实现高精度、低资源消耗双曲正切激活函数的挑战。
  • 克服现有硬件实现中近似精度与计算复杂度之间的权衡。
  • 研究激活函数近似精度对DNN训练和推理性能的影响。
  • 开发一种新型基于DCTIF的近似方法,实现在FPGA上以极小的面积和延迟开销实现高精度。

提出的方法

  • 利用离散余弦变换插值滤波器(DCTIF)通过存储样本和线性插值来近似双曲正切函数。
  • 利用双曲正切函数的奇对称性,仅存储正输入值以减少内存需求。
  • 采用基于DCT的插值方法计算存储样本之间的中间值,从而最小化算术复杂度。
  • 优化DCTIF参数(如滤波器长度、采样密度),以在精度与资源使用之间取得平衡。
  • 仅使用基本算术运算(加法、移位)和小型查找表在Virtex-7 FPGA上实现该架构。
  • 在多种DNN架构和数据集上评估该方法,以评估其对训练和测试精度的影响。

实验结果

研究问题

  • RQ1双曲正切近似的精度在多大程度上影响FPGA上DNN的训练和测试性能?
  • RQ2基于DCTIF的近似方法是否能在使用更少计算和内存资源的前提下,实现比现有方法(如PWL、LUT、混合方法)更高的精度?
  • RQ3为保持与精确双曲正切函数相当的DNN性能,所需的最小近似误差是多少?
  • RQ4在FPGA实现中,不同DCTIF参数配置如何在精度、面积和延迟之间进行权衡?
  • RQ5所提出的方法在多种架构和数据集上在多大程度上保持了DNN的精度?

主要发现

  • 所提出的基于DCTIF的近似方法在Virtex-7 FPGA上仅使用1.52 Kbits存储空间和57个LUT,最大误差为10^-5,其精度-资源比优于先前工作。
  • 在MNIST数据集上,10^-5误差的近似方法保持了95.8%的测试精度,与精确函数性能相当。
  • 在Sinc回归任务中,10^-5误差的近似方法实现了90.287%的训练精度,与精确函数的90.287%相当。
  • 即使最大误差为0.04,训练精度也显著下降(例如,在Cancer数据集中从94.1%降至68.0%),表明低精度近似会降低DNN性能。
  • 研究表明,高精度近似(如10^-5误差)对于保持DNN训练和测试性能至关重要,尤其是在复杂架构中。
  • 在使用相似或更少资源的情况下,DCTIF方法相比先前方法将精度提升了100倍,使其适用于FPGA上的高性能DNN推理。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。