ReLU activation function introduces non-linearity to the neural networks, enabling them to capture complex patterns in the data. It is defined as:
This means that for any input x, if

When observing the graph of ReLU, we see that the function is continuous at x=0, meaning there is no abrupt jump or gap. This continuity is one of the properties a function must have in order to be differentiable.
Note: All differentiable functions are continuous, not all continuous functions are differentiable.
Checking Differentiability at x=0
To determine if a function is differentiable at a point, we need to check that the derivative from the left matches the derivative from the right at that point.
Let’s compute the derivatives:
- Left-hand derivative (
x \to 0^{-} ):
Forx < 0 ,f(x) = 0 , so the derivative isf'(x) = 0 . - Right-hand derivative (
x \to 0^{+} ):
Forx > 0 ,f(x) = x , so the derivative isf'(x) = 1 .
At
Handling Non-Differentiability in Practice
In practical applications, the non-differentiability of the ReLU function at
During the backpropagation process in neural network training, we can adjust the weights using the simplified derivatives:
- For
x > 0 , the slope is 1. - For
x \leq 0 , the slope is 0.
This simplification allows the network to continue training without complications, even though the function is not mathematically differentiable at 0.