Keras 2.x Projects
上QQ阅读APP看书,第一时间看更新

Hyperbolic tangent

Another very popular and widely used activation feature is the tanh function. If you look at the screenshot that follows, you can notice that it looks very similar to sigmoid; in fact, it's a scaled sigmoid function. This is a nonlinear function, defined in the range of values (-1, 1), so you need not worry about activations blowing up. One thing to clarify is that the gradient is stronger for tanh than sigmoid (the derivatives are more steep). The function is defined by the following formula:

The following figure shows a hyberbolic tangent activation function:

Deciding between sigmoid and tanh will depend on your gradient strength requirement. Like the sigmoid, tanh also has the missing slope problem.