双曲正切函数(Tanh)在神经网络中经常被用作激活函数,而其非线性的特点导致难以用硬件电路直接计算实现.为了快速有效的实现Tanh函数,提出采用DCORDIC(Differential Coordinate Rotation Digital Computer)算法在不同模式下实现双曲正弦、双曲余弦函数和除法运算,并在设计中增加选择模块扩大输入数据的范围,最终设计实现的Tanh计算核具有超长流水线,当迭代次数为13时,计算误差在2以内.与现有的硬件实现方式相比,本文的实现方式具有更小的误差、更高的运算速度和更大的吞吐率
Abstract
Hyperbolic tangent function (Tanh) is often used as an activation function in neural networks
but its non-linear character makes it difficult to be realized by hardware circuit directly. In order to implement the Tanh function quickly and efficiently
the DCORDIC(Differential Coordinate Rotation Digital Computer) algorithm is proposed to implement the hyperbolic sine/cosine function and division operation in different modes
and a selection module is added to expand the range of input data. The final design implementation of the tanh computation core has a very long pipeline with a computational error of 2. Compared with the existing hardware implementation methods
the proposed implementation method has smaller error
higher computing speed and greater throughput.
关键词
Keywords
references
ZHANG M, VASSILIADIS S, DELGADOFRIAS J G, et al. Sigmoid generators for neural computing using piecewise approximations[J]. IEEE Transactions on Computers, 1996, 45(9): 1045-1049. DOI: 1045
LEBOEUF K, NAMINA H, MUSCEDERE R, et al. High Speed VLSI Implementation of the Hyperbolic Tangent Sigmoid Function[C]//2008 Third International Conference on Convergence and Hybrid Information Technology. Busan: IEEE, 2008: 1070-1073.
BASTERRETXEAK, TARELAJ M. Approximation of sigmoid functionand the derivative for artificial neurons[C]// Zeng Z G. advances in neural networks and applications. Athens: WSES Press, 2001: 397-401.
ZHU W J. Research and development trend of improved CORDIC algorithm[J]. Popular Science and Technology, 2010(4):17-18+25. DOI: 17
BASTERRETXEAK, TARELAJ M, CAMPOI D. Approximationof sigmoid function and the derivative for hardware implementation ofartificial neurons[J].IEE Proceedings - Circuits, Devices and Systems, 2004, 151(1):18-24. DOI: 18
LIN C, WANG J. A digital circuit design of hyperbolic tangent sigmoid function for neural networks[C]// 2008 IEEE international symposium on circuits and systems. Seattle: IEEE, 2008: 856-859.
PARHAMI B. Generalized signed-digit number systems: a unifying framework for redundant number representations[J]. IEEE Transactions on Computers, 1990, 39(1):89-98. DOI: 89
SONG Y K, GAO X H, ZHANG D L, et al.The piecewise non-linear approximation of the sigmoid function and its implementation in FPGA[J]. Application of Electronic Technique, 2017, 43(8):49-51. DOI: 49
CHANG A X, MARTINI B, CULURCIELLO E, et al. Recurrent Neural Networks Hardware Implementation on FPGA[J]. International journal of advanced research in electrical, electronics and instrumentation engineering, 2015, 5(1): 401-409. DOI: 401
SHRUGAL V, NISHA S, RICHA U.Hardware Implementation Of Hyperbolic Tan Using Cordic On FPGA[J].International Journal of Engineering Research and Applications (IJERA), 2013, 3(2):696-699. DOI: 696
GOMPERTSA, UKILA, ZURFIUHF. Development and Implementation of Parameterized FPGA-Based General Purpose Neural Networks for Online Applications[J].IEEE Trans. On IndustrialInformatics, 2011, 7(1):78-89. DOI: 78