NeuronCanvas
Neural Networks
Activation Functions

Activation Functions

The classic activation functions - sigmoid, tanh, ReLU, Leaky ReLU, and PReLU - and the tradeoffs behind each.

Step 01 - The break

A correction that arrives a million times smaller than it left

A training signal leaves the output layer at full strength. On the way back to the first layer it crosses every layer in between, and each crossing multiplies it by that layer's slope. Not adds. Multiplies.

Sigmoid's slope is at most 0.25, and that maximum happens at one single point on the whole curve.

a signal of 1.000000 leaves the output layer
after 1 sigmoid layer 0.25000000
after 2 0.06250000
after 3 0.01562500
after 5 0.00097656
after 10 0.00000095

And 0.25 is the best case, not the typical one. A neuron whose total has drifted out to 4 has a slope of 0.017663 there, and five of those give 0.0000000017.

Ten layers deep, the correction arriving at the first layer's weights is a millionth of what left the last one. That layer is not learning slowly. On any training budget you actually have, it is not learning.

Nothing in that table is about the shape of a curve. It is about one number attached to each point of it, multiplied over and over.

Step 02 - Before this page
Step 03 - The stage

Two panels. The top one is each curve's value; the bottom one is each curve's slope, which is the panel this page is actually about. Drag the probe and read the numbers underneath, and turn curves off with the checkboxes when five at once is too many.

Preview frame from the "Activation Functions" animation0:14

What this animation shows

On a shared pair of axes, sigmoid, tanh, and ReLU each draw themselves in turn, one curve at a time, in a distinct color with its own label. Watching the three shapes side by side makes their differences visible at a glance: sigmoid and tanh are smooth S-curves with different output ranges, while ReLU is a sharp hinge at zero. This previews the classic activation function family covered on the page.

f(x) - value of each activation

slope (derivative) of each activation

Sigmoid: f(0.00) = 0.500, slope = 0.250
Tanh: f(0.00) = 0.000, slope = 1.000
ReLU: f(0.00) = 0.000, slope = 0.000
Leaky ReLU: f(0.00) = 0.000, slope = 1.000
PReLU: f(0.00) = 0.000, slope = 1.000

Softmax isn't shown here - it doesn't operate on one number at a time the way these do. It gets its own page: Softmax for Multi-Class Output.

Show curves
Overlaid sigmoid, tanh, ReLU, Leaky ReLU, and PReLU curves from x=-4 to x=4, with a vertical probe line showing live values.
Step 04 - One question first

Drag the probe to 0 and read the bottom panel: sigmoid's slope is 0.250, tanh's is 1.000. Now, before you drag anywhere else: at which value of x is sigmoid's slope the largest it will ever be?

Commit to a guess, then open this

Exactly at 0, and the same is true of tanh. Both curves are steepest in the middle and flatten away in both directions, and neither ever gets steeper than it is at zero.

Which is backwards from what you would want. A neuron sitting near zero has not decided anything yet, and that is the neuron most able to be corrected. A neuron out at 4, which is a neuron that has made up its mind, has a slope of 0.017663 and is nearly uncorrectable. The curve is most responsive exactly where the network has least to say and least responsive exactly where it is most confidently wrong.

That single observation is the whole page. Everything below is either measuring it or working around it.

Step 05 - Plain explanation

An activation is a fixed one-number-in, one-number-out step, and the thing that matters about it is not its shape but its slope: how much the output moves when the input moves a hair. That number changes from point to point along the curve, and during training the corrections travelling back through a network are multiplied by one such slope per layer. Multiplication is unforgiving in both directions: a chain of slopes near 1 arrives intact, a chain of slopes near 0.25 arrives at a thousandth of its size, and a single slope of exactly 0 anywhere in the chain ends it.

The limiter and the noise gate

A limiter squashes everything into a fixed range so nothing clips the desk. It works, and it has one consequence you can hear: past a certain input level, playing louder produces no change in the output at all, because the limiter has already given you everything it has. That is saturation, and once a channel is there, riding its fader does nothing audible. A noise gate is the other kind of device: below a threshold it passes absolutely nothing, and above it passes the signal untouched. That is ReLU, and its flaw is the same as a gate's, which is that a source sitting just under the threshold is not quiet, it is gone.

Where it breaks downa gated-out microphone comes back the moment the source gets louder. A dead ReLU neuron receives no gradient, so nothing can make it louder again.

Step 06 - The depth ladder
WordsWhat these things are, and what a slope isOne number in, one number out - plus sigmoid, tanh and ReLU described before any table arrives.Rung 01

An activation function is a plain function: one number in, one number out. It has no weights, learns nothing, and knows nothing about the rest of the network. When a layer of 500 neurons applies ReLU, that is 500 completely independent applications of max(0, z), one per neuron, with no communication between them. The single exception in this whole module is softmax on the last page, which deliberately looks at all the outputs at once.

There is also exactly one activation here with something to learn, PReLU, which owns a single trainable slope. Every other function on this page and the next is fixed for the life of the network.

Which one you pick changes three things: the range the neuron's output can take, how steep the function's slope is, and whether that slope can ever hit exactly zero and strand the neuron. Two of those three are about slope, so slope needs pinning down before the table arrives.

You already know what the slope of a straight line is: go one step right, and slope is how far you went up. Every curve on this page bends, so that single number is not available. A curve has a different slope at every point on it. Measuring it is something you can do by hand, and the method is the definition. Pick a point. Nudge the input by a hair. See how much the output moved. Divide. Rung 2 does exactly that, with numbers.

Sigmoid

The original. It takes any number, however large, and squeezes it into the range 0 to 1, gently, with no hard edges. A very negative input comes out near 0, a very positive one near 1, and 0 comes out at exactly 0.5. That makes its output directly readable as a probability, which is why it survives to this day on the output layer of every binary classifier, and it is the same function that turns a neuron into logistic regression.

Its problem is what happens away from the middle. At z = 4, sigmoid gives 0.982014; at z = 5, 0.993307. A whole unit of input bought about one percent of output. The curve has gone flat, which is called saturation, and a flat curve has a near-zero slope. Sigmoid's slope maxes out at 0.25, at the single best point on the entire curve, and falls away in both directions. Slopes multiply along the chain, so five sigmoid layers can shrink a training signal by 0.25^5 = 0.000977 at absolute best, and much worse in practice, because 0.25 is the best case and most neurons are nowhere near it. That is the vanishing gradient problem, and it is why sigmoid was displaced from hidden layers.

Tanh

The same S-shape as sigmoid, but stretched to run from -1 to 1 and centred so that tanh(0) = 0 exactly. That centring is the entire reason to prefer it in a hidden layer, for the reason spelled out in the zero-centering note below.

It is also steeper where it counts. At its best point its slope is 1.0 against sigmoid's 0.25, exactly four times as steep, and it stays ahead of sigmoid for any zbetween about -1.66 and +1.66, which is where a well-behaved network's pre-activations mostly sit. Push further out than that and the advantage reverses: tanh saturates faster than sigmoid, and by z = 5sigmoid's slope is around 36 times tanh's. So tanh is not uniformly better, and it is worth being exact about that, because it explains the next sentence instead of sitting in tension with it. Tanh saturates too. It just starts from a much better height, and it flattens on both sides rather than only pinning outputs to one end. Tanh remains a reasonable default for small networks and is what this site's playground uses.

ReLU

max(0, z). If the number is positive, hand it back unchanged. If it is negative, hand back zero. That is the whole function, and it is a strange thing to be the most important activation in deep learning, because it is barely a function at all.

It wins on the derivative column. For any positive input the slope is exactly 1, not 0.25, not 0.9, exactly 1, forever, no matter how large the input gets. A training signal passing back through a positive ReLU is multiplied by 1 and comes out unchanged. Chain fifty of them and the signal is still intact. That single property is what made networks deeper than a handful of layers trainable at all, and it is why ReLU is still the default hidden activation you should reach for first. It is also almost free to compute: one comparison, no exponentials.

Its failure mode is the flat half. For any negative input the slope is exactly 0, and zero is a hard number. A neuron whose pre-activation has drifted negative for every example in your data receives a gradient of exactly zero on every one of them, so its weights never change, so its pre-activation stays negative. It is not learning slowly, it has stopped. The name for this is a dead neuron, and the next two rows of the table exist entirely to prevent it.

Leaky ReLU

ReLU's flat zero region for negative inputs means a neuron that ever lands entirely in negative territory gets gradient exactly 0, forever - it "dies" and stops learning. Leaky ReLU tilts that flat floor into a very shallow ramp instead, so there's always some gradient available to recover. Worked: at x=−3, f(x) = 0.01 * (−3) = −0.03 (compare ReLU's hard 0 here). Nudge check confirms the slope in the negative region is exactly α=0.01.

PReLU

Same shape as Leaky ReLU, but instead of hand-picking α, the slope ais a parameter the network learns via gradient descent, just like every weight and bias, typically initialized at a=0.25 (the paper's chosen starting value, not a mathematical requirement). Worked: at x=−2, a=0.25 → f(x)=−0.5. During training, a gets nudged up or down by the same process that updates every other parameter: the same nudge-and-measure test used above for z, applied to a instead - for x≤0, nudging a by a hair moves f(x) by that same hair times x, and for x>0 it moves it not at all. Exactly how that nudge gets computed and applied is covered in full on the backpropagation page; for now, the point is just that PReLU's slope is learned, not hand-picked.

Optional aside - zero-centering

Sigmoid's output is always positive, somewhere between 0 and 1, never negative. That means the gradient signal flowing backward through a sigmoid neuron always carries the same sign as that neuron's own upstream error, which tends to push all of that neuron's incoming weights in the same direction on any given update, even when some of them really ought to move in opposite directions, a slow, zig-zaggy way to train. Tanh, being centered on zero, doesn't have this problem, which is one reason it's often preferred over sigmoid for hidden layers in practice.

NumbersMeasured, then compared inside a real networkSigmoid's slope measured by hand at z = 1.40, then all five curves run through the same rain network.Rung 02
sigmoid at z = 1.40, nudged by 0.001
sigmoid(1.401) = 0.802343
sigmoid(1.400) = 0.802184
output moved 0.000159
input moved 0.001000
slope = 0.000159 / 0.001000 = 0.159

That 0.159 is the slope of sigmoid at the single point z = 1.40. Its formal name is the derivative, and it is written f', said "f prime": f'(1.40) = 0.159. Nudge at a different point and you get a different number, which is the entire premise of this page. A steep spot means a small change going in produces a big change coming out. A flat spot means almost nothing happens no matter what you do.

Five activations, one network

Now the comparison that matters. Same network, same input, same weights, five different hidden activations, traced all the way to the output. This is the small rain network from the previous page: inputs x1 = 0.80, x2 = 0.60, hidden weights (+1.50, +2.00, b = -1.00) and (-1.00, +0.50, b = -0.20), output weights v1 = +1.20 blue, v2 = -0.80 orange, bo = +0.30.

The hidden layer's two pre-activations do not depend on which activation you chose, so they are the same in every row:

z1 = 1.50 * 0.80 + 2.00 * 0.60 - 1.00 = 1.40
z2 = -1.00 * 0.80 + 0.50 * 0.60 - 0.20 = -0.70

Everything after that point differs.

WORKED EXAMPLE - five activations, one network
a1 = f(1.40) a2 = f(-0.70) zo p = sigmoid(zo)
Sigmoid 0.8022 0.3318 0.9972 0.7305
Tanh 0.8854 -0.6044 1.8459 0.8636
ReLU 1.4000 0.0000 1.9800 0.8787
Leaky ReLU 1.4000 -0.0070 1.9856 0.8793
PReLU (a=0.25) 1.4000 -0.1750 2.1200 0.8928
zo = 1.20 * a1 + (-0.80) * a2 + 0.30 in every row.
Values rounded to 4 dp for display; the arithmetic was carried at full precision.

Read it column by column and the table teaches the whole page.

Column a1, the positive input. ReLU, Leaky ReLU and PReLU all hand back 1.4000 untouched, because for positive inputs all three are literally the identity function. Sigmoid crushes 1.40 down to 0.8022 and tanh to 0.8854. The squashing functions are throwing away magnitude information that the ReLU family keeps.

Column a2, the negative input. This is where all five rows separate, and the numbers are worth reading carefully. ReLU gives exactly 0.0000: h2's contribution is deleted. Leaky ReLU gives -0.0070, which is 0.01 * -0.70, technically alive but contributing almost nothing. PReLU with a = 0.25 gives -0.1750, a real signal. Tanh gives -0.6044, the largest number in the column by a distance, because tanh is the only function here that maps a moderately negative input to a strongly negative output rather than shading it toward zero. Sigmoid gives +0.3318, which is positive, because sigmoid's output is positive for every input including very negative ones. A neuron that concluded "no" still emits a positive number, which is precisely the zero-centering complaint in rung 1.

Column p. From 73.1% to 89.3% on identical evidence. Changing nothing but the hidden activation moved the network's final probability by 16 percentage points. This is not a small architectural detail.

PictureThe two panels, read properlyWhat the bottom panel is actually showing, curve by curve, with four probe positions to click.Rung 03

Look at the bottom panel first, and ignore the top one for a moment.

Sigmoid's slope curve is a low hill. It peaks at 0.25 directly above x = 0 and falls away symmetrically. Everything to the left of -2 and to the right of +2 is nearly touching the axis. That whole flat region is where a saturated neuron lives.

Tanh's slope curve is the same shape, four times taller. It peaks at 1.00, also above x = 0. And it is narrower, which is the thing the picture shows and prose gets wrong: past about x = 1.66 the two curves cross and sigmoid's is the higher one from there out. Drag the probe to 3.00 and read it: sigmoid 0.045, tanh 0.010.

ReLU's slope curve is not a curve. It is a floor at 0.000 for every negative x and a ceiling at 1.000 for every positive one, with a vertical jump between them. There is no hill and no falling away. That flat 1.000 stretching off to the right, never sagging however far out you probe, is the entire reason ReLU replaced the S-curves.

Leaky ReLU and PReLU are ReLU with the floor lifted off the axis. At the default a = 0.25, PReLU's negative floor sits at 0.250, which is exactly sigmoid's best-case slope, available on the whole negative half rather than at one point. Leaky ReLU's sits at 0.010 and you have to look closely to see it is not zero. It is not zero, and that is the whole of the difference between a neuron that can recover and one that cannot.

Now the top panel, which is the one people look at first and which matters less. Its only job is to tell you the range: sigmoid between 0 and 1, tanh between -1 and 1, the ReLU family unbounded above. Note that three of the five curves in the top panel are literally the same straight line for every positive x. Nothing distinguishes ReLU, Leaky ReLU and PReLU on the right-hand side at all; everything that separates them is on the left, and most of it is in the bottom panel.

EquationThe formulas, and the slope at the two points the network reachedThe five-row reference table, the nudge check behind its derivative column, and what a slope of exactly 0 does to three weights.Rung 04
FunctionFormulaRangeDerivativeMax derivative
Sigmoidσ(x)=1/(1+e⁻ˣ)(0, 1)σ(x)(1−σ(x))0.25 at x=0
Tanhtanh(x)(−1, 1)1−tanh²(x)1 at x=0
ReLUmax(0,x)[0, ∞)1 if x>0, else 01, constant, never shrinks
Leaky ReLUmax(αx,x), α≈0.01(−∞, ∞)1 or αfixes dying ReLU
PReLUmax(ax,x), a learned(−∞, ∞)1 or aa is a trainable parameter, not fixed

How do we know these derivative formulas are actually right? The honest, no-calculus way to check any slope: nudge the input by a tiny amount and see how much the output moves, divided by that tiny nudge. At x=0: sigmoid(0)=0.500, sigmoid(0.001) ≈ 0.50025, so slope ≈ (0.50025 − 0.500) / 0.001 ≈ 0.25 ✓. tanh(0)=0.000, tanh(0.001) ≈ 0.001, so slope ≈ 1.00 ✓. In other words, tanh's slope at the same point is exactly 4 times steeper than sigmoid's. You'll see this same nudge-and-measure trick again, made fully general, on the gradients page.

The dying-ReLU claim above becomes checkable on this exact network. Here is what each activation's slope is at the two pre-activations the network actually produced:

WORKED EXAMPLE - slope at the two points the network reached
f'(1.40) f'(-0.70)
Sigmoid 0.1587 0.2217
Tanh 0.2162 0.6347
ReLU 1.0000 0.0000
Leaky ReLU 1.0000 0.0100
PReLU (a=0.25) 1.0000 0.2500
Closed-form slopes, each cross-checked against a finite-difference nudge.

Take the ReLU row and follow the consequence. h2's pre-activation is -0.70, so ReLU's slope there is exactly 0. During the backward pass, the gradient reaching h2 gets multiplied by that slope. Zero times anything is zero, so:

gradient for w12 = 0.0000 gradient for w22 = 0.0000 gradient for b2 = 0.0000

Not small. Exactly zero. On this example, h2's three parameters do not move at all, no matter how wrong the network's answer was. If z2 is negative for every example in the training set, those three numbers are frozen for the rest of training and h2 is a dead neuron: it still costs memory and compute, and it contributes a constant 0 to the output forever.

Now the same line for Leaky ReLU: the slope at -0.70 is 0.01, so the gradients are 1% of what they would otherwise be. Tiny, but not zero, and a tiny non-zero gradient can accumulate over thousands of steps and push z2back into positive territory. That recovery route is what "fixes dying ReLU" in the table means, stated as arithmetic.

Also worth noticing in that table: tanh's slope at -0.70 is 0.6347, nearly three times its slope at +1.40 of 0.2162. Both saturating curves are steepest at zero and flatten as you move away, so a neuron sitting far from zero, in either direction, learns slowly.

General caseSlopes multiply, and what to actually useThe one borrowed fact this whole page rests on, then a four-line recommendation you can follow.Rung 05

Now the fact that makes slope the most important column in the table. It is borrowed from the backpropagation page, which derives it properly, and it is stated here rather than proved because everything on this page and the next depends on it:

To work out how a weight in an early layer affects the final loss, the network multiplies together the slope of every step in between. Not adds. Multiplies. A weight five layers from the output has its influence routed through five slopes, and the gradient that arrives back at it is the product of all five.

That single sentence is why a slope is not a piece of trivia about a curve's shape. Multiply five numbers that are each at most 0.25 and you get at most 0.000977, so the signal reaching that early weight is a thousandth of what left the output, and the weight barely moves. Multiply five numbers that are each exactly 1 and the signal arrives intact. Multiply anything at all by a single 0 and it is gone permanently. Those three sentences are the whole argument of the next four pages, and every one of them is a consequence of slopes multiplying.

Which one should you actually use

Short version, and it really is this short for hidden layers.

Start with ReLU. It is the default for a reason: fastest to compute, no vanishing-gradient problem on the positive side, and it works. Most networks never need anything else.

Move to Leaky ReLU or PReLU if neurons are dying. The symptom is a chunk of your hidden layer outputting exactly 0 for every input in your data. Leaky ReLU costs nothing and removes the failure mode. PReLU adds one learnable number per neuron and occasionally helps more, at the cost of one more thing that can overfit.

Use tanh for small networks, or where you need outputs centred on zero. It is what this site's playground uses, because for a two- or three-layer network the vanishing problem never gets a chance to bite and the zero-centred output makes the visualisations honest.

Do not use sigmoid in a hidden layer.Its 0.25 maximum slope and its always-positive output are both liabilities, and tanh is the better of the two for that job over the range a healthy network actually operates in. (Not over every possible input, as the tanh paragraph above is careful to say, but the tails where sigmoid wins are tails you do not want your neurons sitting in anyway.) Sigmoid's place is the output layer of a binary classifier, which is a different decision entirely and gets its own page.

That last distinction is important enough to state plainly: the hidden activation and the output activation are two separate choices. Nothing forces them to match. A network with ReLU throughout its hidden layers and a sigmoid on the output is completely normal, and is in fact the most common binary classifier there is.

Step 07 - Why this and not that

Why this and not that

Why not just use a hard step, above zero is 1 and below is 0?

Its slope is exactly zero everywhere it is defined and undefined at the single point where it jumps. Multiply anything by that zero and the correction is gone. There is nothing to descend. The whole of gradient-based learning requires a curve that responds a little to a little.

Why is ReLU, which is barely a function, better than a carefully designed smooth curve?

Because the property that matters is not smoothness, it is that the slope on the active branch is exactly 1 and stays exactly 1 however large the input gets. Fifty layers of that is fifty multiplications by 1. No smooth S-curve can offer that, because any curve that squashes into a bounded range must eventually flatten, and flattening is the failure.

If sigmoid is so bad, why is it still on every binary classifier's output?

Because the output layer's job is different. There the number has to be readable as a probability, and being bounded between 0 and 1 is the requirement rather than the flaw. One curve, two jobs, opposite verdicts. That distinction gets its own page.

Is tanh always better than sigmoid?

No, and it is worth being exact rather than repeating the slogan. Tanh's slope beats sigmoid's for |z| below about 1.66. Past that, tanh saturates faster, and by z = 5sigmoid's slope is around 36 times tanh's. Tanh is better over the range a healthy network operates in, which is a narrower and true claim.

Why does zero-centering matter?

Sigmoid's output is always positive, so the correction flowing back through a sigmoid neuron carries the same sign into every one of that neuron's incoming weights on any given update, even when some of them should move in opposite directions. That produces a slow zig-zag rather than a straight walk downhill. Tanh, centred on zero, does not have the problem.

Is f'(1.40) = 0.159 the exact slope or the measured one?

Measured, by nudging. The closed form gives 0.158685, which rounds to the 0.1587 in the slope table. The two agreeing is the point of doing it both ways.

Name origins
ReLU
Rectified Linear Unit. "Rectifier" is borrowed straight from electronics, where it names a component that passes current one way and blocks it the other. That is max(0, z) described in a different vocabulary, and it is the most accurate name in the subject.
Leaky
the flat floor "leaks" a small slope instead of holding at exactly zero.
PReLU
Parametric ReLU, because its negative slope is a parameter the network learns rather than a constant you pick.
sigmoid
Greek sigma plus -oid, "S-shaped". Describes the picture.
tanh
hyperbolic tangent, from the hyperbolic trigonometric functions. The name is inherited from mathematics and carries no meaning specific to networks.
saturation
borrowed from chemistry and physics, where a saturated solution is one that cannot dissolve any more salt however much you add. A saturated neuron cannot absorb any more input.
derivative, f'
the prime notation is Lagrange's, from the eighteenth century. "Derivative" because the slope function is derived from the original function.
vanishing gradient
the correction does not become wrong, it becomes small, and then smaller, until it is numerically nothing. It vanishes rather than breaking, which is why it is hard to notice.
Step 08 - Where people go wrong
Step 09 - Practice
  1. 01
    Find, to the nearest probe step, the x where sigmoid and tanh have the same slope. It is not 0.
    Hint
    Start at 1.50 and walk right until the two readouts swap over.
    Answer

    Between 1.65 and 1.70. At 1.65 sigmoid reads 0.135 and tanh 0.137, so tanh is still ahead; at 1.70 sigmoid reads 0.131 and tanh 0.125, so sigmoid has taken over. The exact crossing is at |z| = 1.662886. Below it tanh is the steeper curve; above it sigmoid is.

  2. 02
    Find a point where ReLU and Leaky ReLU differ in the top panel by less than 0.05 but differ in the bottom panel by a ratio you cannot compute.
    Hint
    Anywhere on the negative side.
    Answer

    Any negative x. At x = -4, the top panel shows ReLU at 0.000 and Leaky ReLU at -0.040, a difference of 0.04. The bottom panel shows 0.000 and 0.010, and the ratio is undefined because you cannot divide by zero. That undefined ratio is the whole difference between a neuron that can come back and one that cannot.

  3. 03
    Set PReLU's learnable slope so that a neuron sitting at the rain network's negative pre-activation gets the same slope sigmoid gets at its very best point. Read off what PReLU does to the value there.
    Hint
    Sigmoid's best-ever slope is in the table in rung 4.
    Answer

    a = 0.25, which gives a PReLU slope of 0.250for every negative input, matching sigmoid's single best point across an entire half-line. The value at -0.70 is 0.25 * -0.70 = -0.175000, which is the -0.1750in rung 2's five-activation table.

  4. 04
    Drag the probe until sigmoid's slope drops below 0.02, and then say what the widget's axis is hiding.
    Hint
    Go right and keep going.
    Answer

    It happens at x = 4.00, the extreme right edge, where the slope reads 0.018. The axis stops there; the curve does not. Real pre-activations reach 8 and 12 routinely, where sigmoid's slope is smaller than this by another two orders of magnitude, and the widget cannot show you that. Say it in your head every time you look at this figure.

  5. 05
    Hardest. Using only the two readouts, decide which of the five activations sends the largest correction back through a neuron sitting at z = -0.70, and which sends none at all. Then check your answer against the slope table.
    Hint
    This is one probe position and five numbers.
    Answer

    Tanh sends the most, with a slope of 0.6347, which is nearly three times its own slope at +1.40. ReLU sends nothing, with a slope of exactly 0.0000. The order at that point is tanh 0.6347, PReLU 0.2500, sigmoid 0.2217, Leaky ReLU 0.0100, ReLU 0.0000, and the whole ranking flips at +1.40 where the three ReLU-family curves sit at 1.0000 and both S-curves are under 0.22. There is no activation that is best everywhere, which is why the page is a table and not a recommendation.

Step 10 - Seen in the wild
  • AlexNet, 2012The ImageNet result that started the modern era credits ReLU, in its own body text, for training roughly six times faster than the identical architecture with tanh. The change was one line: max(0, z) in place of a curve.
  • Every image model sinceThey all inherit that line, and the reason it mattered was not accuracy on any single layer but that it made networks deeper than a handful of layers trainable at all.
Step 11 - Memory anchor

Slopes multiply. They never add.

A layer with slope 1 is a clear pane of glass. A layer with slope 0.25 is a tinted one. A layer with slope 0 is a wall. Stack ten panes and you can still see through. Stack ten tints and you cannot. Put one wall anywhere in the stack and it does not matter at all what the other nine are.

Step 12 - The next break

ReLU's wall is the flat half, and Leaky ReLU fixes it with a second straight line, which works and is graceless. There is also a second problem with ReLU that this page never mentioned: it has a corner, and at that corner it has no single slope at all. Ask for the slope at exactly zero and the answer from the left is 0 and from the right is 1.

The model that wrote your last autocomplete uses none of the five curves on this page. The next page is the family that replaced them, what each one is actually fixing, and an honest statement of how much difference any of it makes.

Modern Activation Functions