ReLU, or rectified linear unit, leaves nonnegative inputs unchanged and turns negative inputs into zero: ReLU(x) = x for x ≥ 0, and ReLU(x) = 0 for x < 0. Used between neural-network layers, it helps break linearity and build more complex decision boundaries. section 10.2 section 10.6
For positive inputs, ReLU’s derivative is 1, which helps reduce the vanishing-gradient problem. It is widely used in neural networks, in contrast to sigmoid and tanh, whose flat derivatives can contribute to that problem. section 10.2 section 10.6
ReLU in a Keras network
A classifier for a circular dataset uses ReLU in hidden layers of 128 and 64 units, followed by a two-unit softmax output. A handwritten-digit classifier uses the same hidden-layer sizes and ReLU activations. section 10.3
Figure 10.19 Three different activation functions used in neural networks. Left: The sigmoid function, represented by the Greek letter sigma. Middle: The hyperbolic tangent, or tanh. Right: The rectified linear unit, or ReLU.
Compare the plotted shapes of sigmoid, tanh, and ReLU. section 10.2











