具体而言, Sigmoid
用作LSTM
3个门(进,出,忘记)的门控功能,因为它输出的值介于0和1之间,因此它既不能让信息流过,也不能让信息在信息流中完全流通。另一方面,要克服梯度消失的问题,我们需要一个函数,该函数的二阶导数在变为零之前可以维持很长的范围。 Tanh
具有上述特性,是一个很好的功能。
一个好的神经元单元应该是有界的,易于区分的,单调的(有利于凸优化)并且易于处理。如果您考虑这些质量,那么我相信您可以使用ReLU
代替tanh
函数,因为它们是彼此很好的替代品。但是,在选择激活功能之前,您必须知道选择相对于其他功能的优缺点。我将简要介绍一些激活功能及其优点。
乙状结肠
数学表达式: sigmoid(z) = 1 / (1 + exp(-z))
一阶导数: sigmoid'(z) = -exp(-z) / 1 + exp(-z)^2
优点:
(1) Sigmoid function has all the fundamental properties of a good activation function.
h
数学表达式: tanh(z) = [exp(z) - exp(-z)] / [exp(z) + exp(-z)]
一阶导数: tanh'(z) = 1 - ([exp(z) - exp(-z)] / [exp(z) + exp(-z)])^2 = 1 - tanh^2(z)
优点:
(1) Often found to converge faster in practice
(2) Gradient computation is less expensive
硬丹
数学表达式: hardtanh(z) = -1 if z < -1; z if -1 <= z <= 1; 1 if z > 1
一阶导数: hardtanh'(z) = 1 if -1 <= z <= 1; 0 otherwise
优点:
(1) Computationally cheaper than Tanh
(2) Saturate for magnitudes of z greater than 1
ReLU
数学表达式: relu(z) = max(z, 0)
一阶导数: relu'(z) = 1 if z > 0; 0 otherwise
优点:
(1) Does not saturate even for large values of z
(2) Found much success in computer vision applications
泄漏的ReLU
数学表达式: leaky(z) = max(z, k dot z) where 0 < k < 1
一阶导数: relu'(z) = 1 if z > 0; k otherwise
优点:
(1) Allows propagation of error for non-positive z which ReLU doesn't
本文介绍了一些有趣的激活功能。您可以考虑阅读它。
0
在LSTM Network( 了解LSTM )中,为什么输入门和输出门使用tanh?这背后的直觉是什么?这只是一个非线性变换?如果是,是否可以同时将其更改为另一个激活功能(例如ReLU)?