SQNL
In the context of Artificial Neural Networks, the Square Nonlinearity (SQNL)[1] is an activation function defined mathematically as:
Where x is the input to a neuron/ is the weighted sum. This activation function is similar in shape to the popular Tanh and the computationally efficient softsign/elliotsig..[2] The mathematical proofs and experimental analysis to justify the usability and generalizability of the SQNL function has been shown in the original paper[1]
Properties[edit]
- SQNL exhibits a quadratic nonlinearity.
- The function is continuous (−∞ − +∞), bounded outputs (range = ±2.0) and non-constant in nature
- The SQNL activation function is easily differentiable (fB (x)) and symmetrical in nature which has an advantage in learning as described by the universal approximation theorem[3]
- A smooth transition between the input and output is demonstrated which thereby improves the neural response
Other Commonly used activation functions[edit]
- Tanh
- Hard Tanh
- Softsign
- ISRU[4]
Advantages[edit]
- The quadratic nonlinearity exhibit by SQNL makes it desirable because it uses a square operation instead of an exponent[1].
- The SQNL derivative requires one difference and one multiplication by 0.5. Both of these are single cycle operations and hence have a computational advantage over the derivative of the TanSig function given by (1 − a)(1 + a) where a = TanSig(x)[1]
- From a hardware perspective, the SQNL function can be implemented using Look-Up Table (LUT) or direct implementation using multipliers depending on the speed or available resources.[1]
Computational Speed on ARM M3 processor[edit]
Comparing SQNL function with morphologically similar functions the following are the speedup exhibited
- SQNL is on an average 12x faster than popular Tanh function
- SQNL is 9x faster than the ISRU function[4]
- SQNL is 8x faster than SoftSig function.[2]
Applications and General Usage[edit]
SQNL finds application in various machine learning architectures which include but not limited to Multilayer perceptron (Single Layer Feed Forward Networks), LSTM and so on. The computational simplicity of this function is making it gain acceptance in the deep learning community. It was applied to the Goldilocks Neural Networks architectures[5] Support Vector machine[6] Smooth Activation functions[7][unreliable source?] SQ-RBF[8] Mish[9]
Example[edit]
Computation of SQNL using Python code:
>>> import numpy as np
>>> from scipy import arange
>>> def sqnl(x):
if x > 2.0:
y = 1.0
elif x < -2.0:
y = -1.0
elif x <= 2.0 and x >= 0:
y = x - (x*x)/4.0
else:
y = x + (x*x)/4.0
return y
>>> sqnl = np.vectorize(sqnl)
>>> x = np.arange(-3.0,3.0,0.1)
>>> sqnl(x)
Here is an example of MATLAB code: The full implementation of SQNL as a toolbox in MATLAB is available on this project's repository "SQNL_MATLAB". Retrieved 2019-09-28.
function a = sqnl(n)
a = zeros(size(n));
idx = find(n > 2);
n(idx) = 2;
idx = find(n < -2);
n(idx) = -2;
idx = find(n >= 0);
a(idx) = n(idx) - n(idx).^2/4;
idx = find(n < 0);
a(idx) = n(idx) + n(idx).^2/4;
end
References[edit]
- ↑ 1.0 1.1 1.2 1.3 1.4 Wuraola, Adedamola; Patel, Nitish (2018). "SQNL: A New Computationally Efficient Activation Function". 2018 International Joint Conference on Neural Networks (IJCNN). pp. 1–7. doi:10.1109/IJCNN.2018.8489043. ISBN 978-1-5090-6014-6. Search this book on
- ↑ 2.0 2.1 Elliot, David L. (1993), "A better activation function for artificial neural networks", ISR Technical Report TR 93-8, University of Maryland, College Park, MD 20742, CiteSeerX 10.1.1.46.7204
- ↑ Hornik, Kurt (1991). "Approximation capabilities of multilayer feedforward networks". Neural Networks. 4 (2): 251–257. doi:10.1016/0893-6080(91)90009-T.
- ↑ 4.0 4.1 Carlile, Brad; Delamarter, Guy; Marti, Akiko; Whitney, Brian (2017). "Improving Deep Learning by Inverse Square Root Linear Units (ISRLUs)". arXiv:1710.09967 [cs.LG].
- ↑ Rosenzweig, Jan; Zoran, Cvetkovic; Ivana, Roenzweig (2018). "Goldilocks Neural Networks". arXiv:2002.05059 [cs.LG].
- ↑ Farokhi, Farhad (2020), "Privacy-Preserving Public Release of Datasets for Support Vector Machine Classification", IEEE Transactions on Big Data, 20 (6), p. 5, Bibcode:2018CSE....20f...5., doi:10.1109/MCSE.2019.2893163
- ↑ Ohn, Ilsang; Kim, Yongdai (2019). "Smooth Function Approximation by Deep Neural Networks with General Activation Functions". Entropy. 21 (7): 627. arXiv:1906.06903. Bibcode:2019Entrp..21..627O. doi:10.3390/e21070627.
- ↑ Wuraola, Adedamola; Patel, Nitish (2018), "Computationally Efficient Radial Basis Function", International Conference on Neural Information Processing, Springer
- ↑ Misra, Diganta (2019). "Mish: A Self Regularized Non-Monotonic Neural Activation Function". arXiv:1908.08681 [cs.LG].
This article "SQNL" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:SQNL. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.