Tanh
The hyperbolic tangent function, commonly known as Tanh, is a mathematical function that describes the relationship between the hyperbolic sine and hyperbolic cosine. It is defined as the ratio of these two functions: Tanh(x) = sinh(x) / cosh(x). The output values of Tanh range from -1 to 1, making it useful in various applications, particularly in neural networks as an activation function.
Tanh is often preferred over the sigmoid function because it centers the data around zero, which can lead to faster convergence during training. Its shape resembles an "S" curve, allowing it to smoothly transition between its minimum and maximum values. This characteristic helps in modeling complex relationships in data.