Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Let the network choose its own activation
Every activation so far was a fixed curve. A maxout unit instead computes several straight lines from its input and outputs whichever is highest. The upper envelope of a set of lines can bend into many shapes: a ReLU (one line at zero), an absolute value (lines going up both ways), or a smooth-looking bowl with enough lines. Training adjusts the lines, so the network learns its own activation.
Maxout networks are piecewise linear like ReLU networks, so they stay cheap and verifiable, but each unit is more flexible and never dies. The idea of taking a maximum over learned affine pieces also appears in convex model-predictive control, input-convex networks and piecewise-affine system identification.
- 1. A maxout unit outputs…
- 2. Maxout with pieces z and 0 is…
- 3. Can a maxout unit have zero gradient for every input?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.By hand
- Definition: hᵢ(x) = max over j = 1…k of (w_ijᵀx + b_ij). A layer of u maxout units has u·k pieces.
- Example: pieces (1, 3) and (−2, −5) per unit give outputs 3 and −2.
- Special cases: max(z, 0) = ReLU; max(z, −z) = |z|; max(z, az) = leaky ReLU with slope a < 1.
- Gradient routing: the upstream gradient goes entirely to the winning piece; the others get 0. For the example above with upstream (10, 20), the gradients are (0, 10, 20, 0).
- Convexity: a maximum of affine functions is convex, so a single maxout unit can represent only convex functions of its input. A difference of two maxout units can represent any continuous piecewise-linear function.
- Parameters: a maxout layer with u units of k pieces on d inputs has (d + 1)·u·k parameters: 64 inputs, 32 units and k = 2 give 4160.
- 1. max(z, −z) =
- 2. A single maxout unit can represent…
- 3. The losing pieces of a maxout unit receive gradient…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 25 minUndergraduate students and practising engineers.Approximating convex functions
Exercise 1. The analytic maxout gradient matches finite differences, and ReLU and |x| are reproduced exactly as maxout units. A maxout unit whose k pieces are tangent lines of x² at the centres of k equal cells of [−1, 1] approximates x² with maximum error:
| k | 2 | 4 | 8 | 16 |
|---|---|---|---|---|
| max error | 0.2500 | 0.0625 | 0.0156 | 0.0039 |
That is exactly 1/k². The error falls quadratically with the number of pieces, so 10 pieces give 0.01.
Practical notes.
- Implementation: compute a linear layer of width u·k, reshape to (n, u, k), and take the max over the last axis.
- Cost: k times the parameters of a ReLU layer with u outputs. Equivalently, at a fixed matrix width, maxout has k times fewer output units.
- With dropout: Goodfellow et al. designed maxout to make dropout’s approximate model averaging more accurate. Maxout networks with dropout set records on MNIST, CIFAR-10 and SVHN in 2013.
z = linear(x).view(n, u, k); h = z.max(dim=-1).values # maxout layer- 1. Max error of 4 tangents to x² on [−1, 1]?
- 2. Pieces needed for error 0.01?
- 3. Maxout was designed to work well with…
Level 3: Advanced
★★★★☆ Advanced⏱ 25 minGraduate level, with full derivations and proofs.Theory
Universal approximation. Any continuous function on a compact set can be approximated by a difference of two convex piecewise-linear functions. Each of those is a single maxout unit with enough pieces. So a maxout network with two hidden units and one linear output (their difference) is a universal approximator, given enough pieces per unit (Goodfellow et al., 2013).
Convex approximation rate. For a convex function with bounded second derivative f″ ≤ M on an interval of length L, k equally spaced tangents give error at most M(L/k)²/8. For x² on [−1, 1], M = 2 and L = 2, so the error is 2·(2/k)²/8 = 1/k², as measured.
Why units do not die. Some piece is always the maximum, so every maxout unit always passes gradient to one of its pieces. A constant added to all of a unit’s biases does not change which piece wins: it only shifts the output. This is why a negative bias initialisation, which kills ReLU units, cannot kill maxout units. A unit can, however, get stuck on one piece for every input, making it linear, the analogue of a dead unit.
Relation to other models.
- Maxout is a learned piecewise-linear activation, in the same family as ReLU, leaky ReLU and PReLU.
- Input-convex neural networks (Amos et al., 2017) use max-affine structure to guarantee convexity in the input, useful for optimisation-based control.
- Max-affine regression is a classical tool for fitting convex functions.
- 1. A universal maxout approximator uses…
- 2. Adding the same constant to all of a unit's piece biases changes…
- 3. The analogue of a dead ReLU in maxout is a unit…
Level 4: Expert
★★★★★ Expert⏱ 25 minResearchers: original papers and open problems.Maxout versus ReLU, and the bias test
History.
- I. Goodfellow, D. Warde-Farley, M. Mirza, A. Courville and Y. Bengio (2013) introduced maxout networks with dropout.
- Earlier, local winner-take-all and channel-out networks used similar competition between units.
- Maxout later appeared in speech recognition and in some GAN discriminators, before cheaper rectifiers with normalisation became dominant.
Exercise 2. A 3-hidden-layer network on spirals, trained with minibatch SGD at learning rate 0.3. Every hidden layer has 64 linear pieces: ReLU with 64 units (k = 1), or maxout with 32 units of 2 pieces or 16 units of 4. Because maxout layers have fewer outputs, they also have fewer parameters. The hidden biases start at 0 or at −0.5, the setting that killed ReLU units in E1-4. The last column is the fraction of ReLU units dead, or of maxout units stuck on one piece, for all training data.
| k | parameters | initial bias | accuracy after 50 steps | after 300 | dead or stuck |
|---|---|---|---|---|---|
| 1 (ReLU) | 8707 | 0 | 0.970, 0.920, 0.978 | 1.000, 1.000, 1.000 | 0.040 |
| 1 (ReLU) | 8707 | −0.5 | 0.480, 0.350, 0.605 | 0.957, 0.947, 0.997 | 0.260 |
| 2 | 4515 | 0 | 0.998, 0.987, 0.998 | 1.000, 1.000, 1.000 | 0.042 |
| 2 | 4515 | −0.5 | 1.000, 1.000, 1.000 | 1.000, 1.000, 1.000 | 0.003 |
| 4 | 2419 | 0 | 0.997, 0.997, 0.988 | 1.000, 1.000, 1.000 | 0.007 |
| 4 | 2419 | −0.5 | 1.000, 0.998, 1.000 | 1.000, 1.000, 1.000 | 0.000 |
- Maxout learned faster with fewer parameters. After 50 steps it was at 0.99–1.00, against ReLU’s 0.92–0.98, with half or a quarter of the parameters.
- The bias test did not affect maxout. The −0.5 initialisation killed 26% of ReLU units and cut early accuracy to 0.35–0.61, while maxout’s results were unchanged. As shown in Level 3, a bias shared by all pieces cannot change which piece wins.
- The comparison counts pieces, not parameters. At equal parameters, maxout would have fewer pieces per layer. Each maxout unit also costs k multiply-adds per output, which is why cheaper rectifiers with normalisation replaced it in most modern networks.
Maxout in AI, robotics and aerospace
- Convex learned models for control: max-affine and input-convex networks give cost or value functions that a model-predictive controller can minimise reliably.
- Piecewise-affine identification: hybrid systems (contact, saturation, mode switches) are naturally modelled as maxima or minima of affine pieces.
- Verification: like ReLU networks, maxout networks are piecewise linear and can be verified exactly with mixed-integer programming.
References
- I. J. Goodfellow, D. Warde-Farley, M. Mirza, A. Courville, Y. Bengio (2013). “Maxout networks.” Proc. ICML.
- B. Amos, L. Xu, J. Z. Kolter (2017). “Input convex neural networks.” Proc. ICML.
- A. Magnani, S. P. Boyd (2009). “Convex piecewise-linear fitting.” Optimization and Engineering 10(1).