A Method for Calculating the Derivative of Activation Functions Based on Piecewise Linear Approximation

被引:3
|
作者
Liao, Xuan [1 ]
Zhou, Tong [2 ]
Zhang, Longlong [1 ]
Hu, Xiang [1 ]
Peng, Yuanxi [1 ]
机构
[1] Natl Univ Def Technol, Coll Comp Sci & Technol, State Key Lab High Performance Comp, Changsha 410073, Peoples R China
[2] Natl Univ Def Technol, Beijing Inst Adv Study, Beijing 100000, Peoples R China
关键词
activation functions; piecewise linear approximation; back-propagation;
D O I
10.3390/electronics12020267
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Nonlinear functions are widely used as activation functions in artificial neural networks, which have a great impact on the fitting ability of artificial neural networks. Due to the complexity of the activation function, the computation of the activation function and its derivative requires a lot of computing resources and time during training. In order to improve the computational efficiency of the derivatives of the activation function in the back-propagation of artificial neural networks, this paper proposes a method based on piecewise linear approximation method to calculate the derivative of the activation function. This method is hardware-friendly and universal, it can efficiently compute various nonlinear activation functions in the field of neural network hardware accelerators. In this paper, we use least squares to improve a piecewise linear approximation calculation method that can control the absolute error and get less number of segments or smaller average error, which means fewer hardware resources are required. We use this method to perform a segmented linear approximation to the original or derivative function of the activation function. Both types of activation functions are substituted into a multilayer perceptron for binary classification experiments to verify the effectiveness of the proposed method. Experimental results show that the same or even slightly higher classification accuracy can be achieved by using this method, and the computation time of the back-propagation is reduced by 4-6% compared to the direct calculation of the derivative directly from the function expression using the operator encapsulated in PyTorch. This shows that the proposed method provides an efficient solution of nonlinear activation functions for hardware acceleration of neural networks.
引用
收藏
页数:10
相关论文
共 50 条
  • [21] Piecewise Linear Approximation Based MILP Method for PVC Plant Planning Optimization
    Gao, Xiaoyong
    Feng, Zhenhui
    Wang, Yuhong
    Huang, Xiaolin
    Huang, Dexian
    Chen, Tao
    Lian, Xue
    INDUSTRIAL & ENGINEERING CHEMISTRY RESEARCH, 2018, 57 (04) : 1233 - 1244
  • [22] Piecewise Linear Approximation by the Method of Worst Segment Division
    Sukiasyan, H. S.
    LOBACHEVSKII JOURNAL OF MATHEMATICS, 2021, 42 (12) : 2969 - 2979
  • [23] Optimal breakpoint selection method for piecewise linear approximation
    Liu, Shaojun
    arXiv,
  • [24] Approximation order analysis for the piecewise linear Markov method
    Ding, J
    Wang, Z
    STOCHASTIC ANALYSIS AND APPLICATIONS, 2001, 19 (06) : 911 - 923
  • [25] Piecewise Linear Approximation by the Method of Worst Segment Division
    H. S. Sukiasyan
    Lobachevskii Journal of Mathematics, 2021, 42 : 2969 - 2979
  • [26] ON PIECEWISE LINEAR FUNCTIONS AND PIECEWISE LINEAR EQUATIONS
    SCHRAMM, R
    MATHEMATICS OF OPERATIONS RESEARCH, 1980, 5 (04) : 510 - 522
  • [27] Similarity measure based on piecewise linear approximation and derivative dynamic time warping for time series mining
    Li, Haili
    Guo, Chonghui
    Qiu, Wangren
    EXPERT SYSTEMS WITH APPLICATIONS, 2011, 38 (12) : 14732 - 14743
  • [28] OPTIMUM PIECEWISE-LINEAR TRANSCODERS .1. WEIGHTED MINIMAX PIECEWISE-LINEAR APPROXIMATION AND MINIMAX DECOMPOSITION OF PIECEWISE FUNCTIONS
    DEVILLE, Y
    INTERNATIONAL JOURNAL OF ELECTRONICS, 1994, 77 (06) : 823 - 844
  • [29] Piecewise Linear Approximation of Generators Cost Functions Using Max-Affine Functions
    Ahmadi, Hamed
    Marti, Jose R.
    Moshref, Ali
    2013 IEEE POWER AND ENERGY SOCIETY GENERAL MEETING (PES), 2013,
  • [30] Approximation Properties of Dicrete Fourier Sums for Some Piecewise Linear Functions
    Akniyev, G. G.
    IZVESTIYA SARATOVSKOGO UNIVERSITETA NOVAYA SERIYA-MATEMATIKA MEKHANIKA INFORMATIKA, 2018, 18 (01): : 4 - 16