TensorFlow 2.0 RC is available Learn more

tf.keras.activations.tanh

TensorFlow 2.0 version View source on GitHub

Hyperbolic Tangent activation function.

Aliases:

  • tf.compat.v1.keras.activations.tanh
  • tf.compat.v2.keras.activations.tanh
tf.keras.activations.tanh(x)

Arguments:

  • x: Input tensor.

Returns:

The tanh activation: tanh(x) = sinh(x)/cosh(x) = ((exp(x) - exp(-x))/(exp(x) + exp(-x))).