§6.3.1 Rectified linear units and their generalizations
The ReLU rectified linear unit g(z) = max{0, z}: the default hidden unit — near-linear, large consistent gradients, easy to optimize; dead where its activation is 0. (First introduced ch01.) defined in ch. 6 — open in glossary is easy to optimize precisely because it is so nearly linear: its derivative is 1 wherever the unit is active and its second derivative is 0 almost everywhere, so gradients stay large and consistent — far more useful than activations that introduce curvature. (Tip: initialize biases to a small positive value like 0.1 so units start active.) The one drawback: a unit whose activation is 0 gets no gradient. Its generalizations fix that with a nonzero slope for , :
- Absolute value rectification absolute value rectification A ReLU generalization with slope α = −1 for z < 0, giving g(z) = |z|; used for polarity-invariant image features. defined in ch. 6 — open in glossary fixes → (polarity-invariant image features).
- Leaky ReLU leaky relu ReLU with a small fixed negative slope (α ≈ 0.01) so units keep receiving gradient when inactive. defined in ch. 6 — open in glossary fixes small (≈ 0.01).
- Parametric ReLU (PReLU) parametric relu (PReLU) leaky-ReLU whose negative slope α is a learned parameter. defined in ch. 6 — open in glossary makes a learned parameter.
Compare them all — toggle curves, drag the probe, and watch which units go “flat” (saturate) where:
A curve tagged "flat" at the probe has a near-zero derivative there — a saturating unit that starves gradient-based learning.
Maxout
Maxout units maxout unit Outputs the max over a group of k linear pieces — learns a piecewise-linear convex activation itself; needs more regularization; resists catastrophic forgetting. defined in ch. 6 — open in glossary go further: divide into groups of and output each group’s maximum, (toggle it on above). A maxout unit learns the activation function itself — a piecewise-linear convex function of up to pieces — so with it can become ReLU, absolute-value rectification, or leaky/parametric ReLU, or something new.
What maxout buys, and costs
Each unit is now weight vectors, so maxout needs more regularization (unless the dataset is large and k small). Upsides: it can save parameters (max over k filters lets the next layer use k× fewer weights), and its filter redundancy resists catastrophic forgetting catastrophic forgetting When a network forgets tasks it was previously trained on; maxout's filter redundancy helps resist it. defined in ch. 6 — open in glossary — losing previously-learned tasks. The whole ReLU family rests on one principle: models optimize more easily when their behavior is closer to linear — the same reason the LSTM propagates information through time by summation (§10.10).
§6.3.2 Sigmoid and tanh — usually the wrong hidden unit
and (related by ) saturate across most of their domain — flat, gradient-killing everywhere except near 0 — so their use as hidden units is now discouraged (as output units, paired with a log-based cost that undoes the saturation, they’re fine). When a sigmoidal unit is required, the hyperbolic tangent hyperbolic tangent tanh(z) = 2σ(2z) − 1: a sigmoidal activation preferred over the logistic sigmoid as a hidden unit because tanh(0) = 0 resembles the identity near 0. defined in ch. 6 — open in glossary beats the logistic sigmoid: (vs ), so it resembles the identity near 0 and a small-activation tanh network trains much like a linear one. Sigmoidal units remain common in recurrent nets, probabilistic models, and some autoencoders, whose extra requirements rule out piecewise-linear units.
§6.3.3 Other hidden units — and a cautionary tale
Many differentiable functions work fine; new types are published only when clearly better (the authors got under 1% MNIST error with ). Notable ones: linear/identity hidden units (factor a layer low-rank, with parameters), softmax as a memory switch, RBF (saturates to 0, hard to optimize), hard tanh, and — a warning — softplus: smooth and differentiable everywhere, yet empirically worse than ReLU. “The performance of hidden unit types can be very counterintuitive”; smoothness is no guarantee.
§6.4 Architecture · §6.4.1 Universal approximation and depth
Architecture = how many units and how they connect. The common chain arranges layers ; the main choices are depth and per-layer width. Remarkably, one hidden layer already suffices to represent anything:
Term by term
| a feedforward net with a linear output and ≥1 hidden layer of a squashing activation can approximate ANY Borel-measurable function (e.g. any continuous function on a closed bounded set) to any nonzero error — given enough hidden units. Also holds for ReLU (Leshno 1993) | representability | |
| it does NOT promise the training algorithm will FIND that function: optimization can fail, or overfit (NFL, §5.2.1) | the gap | |
| the theorem says a big-enough net exists, not how big — worst case, exponentially many units (2^(2ⁿ) binary functions on n bits) | the catch |
So why go deep? Because depth buys exponential efficiency:
Fig 6.5 (recreated) — an absolute-value rectification unit gives the same output for mirror-image inputs; composing these folds yields exponentially many piecewise-linear regions, so a deep rectifier net can need exponentially fewer units than a shallow one.
There is also a statistical reason. Choosing a deep model encodes a prior: that the target is a composition of simpler functions (a representation built of simpler representations — corners from edges) or a multi-step program (each step uses the previous step’s output). Empirically, greater depth generalizes better across many tasks (figs 6.6–6.7 — and crucially, adding depth beats adding the same number of parameters as width). Depth expresses a genuinely useful prior over functions.
Next: the rest of architecture (skip/sparse connections) and the algorithm that computes all these gradients — back-propagation.
Check yourself — hidden units, depth, universal approximation
1.Why is the ReLU easy to optimize, and what is its one drawback?
2.In ActivationLab, drag the probe to z = −3 with sigmoid, tanh, and ReLU shown. Which get tagged 'flat', and what does that mean?
3.What can a maxout unit do that a single ReLU cannot?
4.The universal approximation theorem says one hidden layer can approximate any Borel-measurable function. What does it NOT guarantee?
5.Give one reason — beyond the region-folding count — to prefer a deep model.