flax.linen.activation.tanh#
- flax.linen.activation.tanh(x, /)#
Compute hyperbolic tangent element-wise.
LAX-backend implementation of
numpy.tanh()
.Original docstring below.
Equivalent to
np.sinh(x)/np.cosh(x)
or-1j * np.tan(1j*x)
.- Parameters
x (array_like) – Input array.
- Returns
y – The corresponding hyperbolic tangent values. This is a scalar if x is a scalar.
- Return type
ndarray
References
- 1
M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions. New York, NY: Dover, 1972, pg. 83. https://personal.math.ubc.ca/~cbm/aands/page_83.htm
- 2
Wikipedia, “Hyperbolic function”, https://en.wikipedia.org/wiki/Hyperbolic_function