It is defined as:
tanh(x) = sinh(x) / cosh(x)
, i.e.
tanh(x) = ((exp(x) - exp(-x)) / (exp(x) + exp(-x)))
.
See also
Other activations: activation_elu()
activation_exponential()
activation_gelu()
activation_hard_sigmoid()
activation_leaky_relu()
activation_linear()
activation_log_softmax()
activation_mish()
activation_relu()
activation_relu6()
activation_selu()
activation_sigmoid()
activation_silu()
activation_softmax()
activation_softplus()
activation_softsign()