The hyperbolic tangent, or tanh, is an activation function that adds nonlinearity to neural networks. Like sigmoid, it transforms each input nonlinearly, but its outputs range from −1 to 1 rather than 0 to 1, so the response is centered around zero. section 8.1.2
Its training advantage follows from the behavior of its gradient:
- Near x = 0, tanh has a larger derivative than sigmoid, producing stronger weight updates and potentially faster convergence. section 8.1.2
- This advantage applies mainly when inputs are centered around zero, as after standardization. section 8.1.2
- Without a nonlinear activation, stacking linear layers would still produce only a single linear transformation. section 11.1
tanh in LeNet
LeNet places a tanh activation layer after every feature map in its convolutional layers. These activations let the network model nonlinear combinations of image inputs; the original architecture used tanh, although ReLU and sigmoid are alternatives. section 11.1
Figure 8.4 Graph of a 1D tanh function.
Inspect the graph to connect tanh's centered output range with its activation-curve shape. section 8.1.2
Figure 8.5 Graph of the derivatives of 1D sigmoid and tanh functions
Compare the tanh and sigmoid derivative graphs to visualize their different gradient strengths near zero. section 8.1.2



