tanh

dragon.math.tanh(
  inputs,
  **kwargs
)[source]

Apply the tanh function.

The Tanh function is defined as:

\[\text{Tanh}(x) = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}} \]

Examples:

x = dragon.constant([0.2, 0.4, 0.6, 0.8, 1.0], 'float32')
print(dragon.math.tanh(x))
Parameters:
Returns:

dragon.Tensor – The output tensor.