Log inStart free
LESSON 5.05 · 5 STAGES · 2 CONTROLS · 3 CHECKSPRO · PREVIEW

ReLU and Leaky ReLU

Watch one big step switch a ReLU unit off for good.


Pro lesson. Stage 1 is free to watch. Pro opens all 5 stages, 2 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 5.05 · ACTIVATION BAYALPHA 0 · SLOPE 1 ABOVE 0, 0 BELOW
01
Stage 1 of 5 · The ReLU
ReLU keeps a positive z and turns a negative z into 0. Its slope is 1 or 0.
Explain it simply

The bent line is the activation. Right of zero it rises with slope one, so the error signal passes back at full strength. Sigmoid's steepest slope is only a quarter, so its signal shrinks at every layer. Left of zero ReLU is flat, so no signal passes back.

A graph of the activation. Eight teal dots on the right arm show the 8 inputs of unit 1. The left arm has slope 0.

inputs, z > 0bias, leak αloss, dead unitoutputz ≤ 0
zf(z)activation funit 1, step 0slope 1slope 0the activationf(z) = max(αz, z): f(0.49) = 0.49, slope 1f(−1.00) = 0.00, slope 0zf(z)activation funit 1, step 0slope 1slope 0the activationf(z) = max(αz, z): f(0.49) = 0.49, slope 1f(−1.00) = 0.00, slope 0
Toy: 1-4-1 MLP · 8 points of y = 1.5x² − 0.5 · full-batch gradient descent, 500 steps
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
f(z)=max⁡(α z, z)\sy{f}{out}{f}(\sy{z}{data}{z}) = \max(\sy{a}{param}{\alpha}\,\sy{z}{data}{z},\ \sy{z}{data}{z})
α=0, f′(z>0)=1, f′(z<0)=0\alpha = 0,\ f'(z>0) = 1,\ f'(z<0) = 0

Above 0 the output is z; below 0 it is α times z.

Common mix-ups

MYTHA dead ReLU unit comes back later in training.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01At learning rate 0.05, does unit 1 switch off in the first step?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 more stages and 2 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.