The Tanh (Hyperbolic Tangent) function is an activation function in neural networks that maps its inputs to the range between -1 and +1. This keeps the mean of the outputs closer to zero and makes learning easier than with the Sigmoid function. It is commonly used in simple neural networks because it represents data with both positive and negative values better, but like Sigmoid it also suffers from the vanishing gradient problem for very large or very small inputs, which is why deep networks often replace it with functions such as ReLU.
