NumPy ufuncLesson 43Free preview
ufunc Hyperbolic
This lesson is part of NumPy · All levels
Summary
Hyperbolic functions such as np.sinh, np.cosh, and np.tanh are exponential shapes that resemble trigonometric waves, but are not repeatable. np.tanh is important in machine learning because the result is always in the range of -1 to 1, similar to the sigmoid activation function. Alternatives such as arcsinh, arccosh, and arctanh are also available.
Key points
- Sinh, cosh, tanh is defined from the exponential function e^x.
- The resulting value is finite between -1 and 1, which is appropriate for activation.
- Inverse function: np.arcsinh, np.arccosh, np.arctanh.
- The work of the element-wise receives radians like ordinary trigonometry.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.