liveBook · Manning

ReLU

As explained in Grokking AI Algorithms, Second Edition

A ReLU is an activation function that outputs zero for negative inputs and a linearly increasing value for positive inputs.

A ReLU, or rectified linear unit, is an activation function: it replaces every negative input with 0 and leaves positive values unchanged. This simple rule adds nonlinearity to a neural network. section 11.25

ReLU is useful because some neurons can remain inactive instead of all activating at once. That can reduce computation and may help the network find solutions faster, unlike activation functions whose extreme values can contribute to vanishing gradients. section 9.10

Applying ReLU step by step

Given the vector [1.5921, 0.3436, -0.5260, 1.7674, -0.4769], ReLU scans each value independently. The positive values stay the same, while the negative values become zero, producing [1.5921, 0.3436, 0, 1.7674, 0]. In a projection layer, this happens after multiplying by weights and adding a bias. section 11.25

How Grokking AI Algorithms, Second Edition covers it

How deep it goes
Explains the elementwise rule and traces a vector example, but does not develop derivatives or optimization details.
Examples
Demonstrates ReLU on a five-value vector and places it after weight multiplication and bias addition in a projection layer.
What it assumes
Assumes familiarity with neural-network neurons, weights, bias vectors, and activation functions.
What you can do after
Apply ReLU element by element after a neural-network layer’s weighted sum and bias addition.
How it connects
Connects ReLU with activation functions, sigmoid, hyperbolic tangent, vanishing gradients, feed-forward sublayers, and Transformer blocks.

Also explained in

Compare how 12 books explain ReLU →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking AI Algorithms, Second Edition. The section links point to the parts of the book it draws on.