tf.keras.activations.tanh

Hyperbolic tangent activation function.

It is defined as:

tanh(x) = sinh(x) / cosh(x), i.e. tanh(x) = ((exp(x) - exp(-x)) / (exp(x) + exp(-x))).

x Input tensor.