Image for Tanh

Tanh

Tanh, or hyperbolic tangent, is a mathematical function that maps any real number to a value between -1 and 1. It’s similar to a scaled version of the sigmoid function but is symmetric around zero, meaning negative inputs produce negative outputs, positive inputs produce positive outputs, and zero maps exactly to zero. Tanh is often used in neural networks to introduce non-linearity, helping the model learn complex patterns by transforming inputs into a standardized range. Its smooth, continuous curve allows it to effectively model relationships and gradients during training.