Hyperbolic Tangent
Apply the hyperbolic tangent activation.
Description
Apply the hyperbolic tangent activation.
Hyperbolic Tangent: Apply the hyperbolic tangent activation.
When to use Hyperbolic Tangent
Use this function when exploring or implementing a neural-network layer that needs a smooth, bounded, zero-centered nonlinear response.
- X
- Input value.
How Hyperbolic Tangent works
Apply the hyperbolic tangent activation. The tool evaluates the supplied inputs together and returns the named outputs below; it does not infer omitted operating conditions or change the units shown.1
- Y
- tanh(x).
Limitations and assumptions
- Hyperbolic tangent saturates near −1 and 1, where gradients become small. Network behavior also depends on initialization, normalization, architecture, data, and optimization rather than the activation alone.
- Use finite inputs in the displayed units and preserve more precision than the final presentation requires. Independently verify safety-critical, financial, compliance, or production decisions.
Alternative or Complementary approaches
Compare tanh with sigmoid, ReLU, leaky ReLU, or another activation under the same model and training conditions. Inspect both forward values and gradients when diagnosing saturation.
References
-
Activation function — Wikipedia contributors
Similar or alternative tools
- Leaky ReLU
Apply the leaky ReLU activation, scaling negatives by a small slope.
- ReLU
Apply the rectified linear activation, flooring negatives at zero.
- Sigmoid
Apply the logistic sigmoid activation.