What is the Tanh function?

Tanh (hyperbolic tangent) is an activation function that maps numbers to the range between -1 and +1. It resembles Sigmoid, but its outputs are centered around zero, which makes it better at representing data with both positive and negative values. It is used in the hidden layers of neural networks, but like Sigmoid it can suffer from vanishing gradients in deep networks.