Approximation Theory and Backpropagation
Universal approximation with its exact hypotheses, why it says nothing about learnability, and backpropagation as reverse-mode differentiation on a computational graph.
From the perceptron to a hidden layer
There is no with equal to on .
This is the observation that halted the first wave of neural network research, and the fix — compose two layers — is what the next theorem generalises.
Universal approximation
Let be continuous and not a polynomial. Then for every compact , every continuous and every , there exist , , and with
Quoted from Leshno et al., which gives the sharp hypothesis; Cybenko and Hornik proved earlier versions for sigmoidal and for bounded non-constant activations. The proof is a functional-analysis argument (the set of such sums is a subalgebra-like family whose closure is shown to be all of , via Stone–Weierstrass or via a Hahn–Banach separation and a Fourier/Radon-transform computation).
The theorem is a statement about the closure of a set of functions. It provides:
- no bound on — the width may need to grow exponentially in or in ;
- no algorithm for finding the parameters;
- no statement about generalisation from finite data;
- no distinction between activations, architectures or depths.
There is a function , expressible exactly by a network with three layers and units, such that any two-layer network approximating to constant accuracy in over a natural measure requires units.
Quoted from Eldan and Shamir; Telgarsky gives a complementary one-dimensional construction separating depth from depth using a sawtooth function whose oscillation count grows exponentially with depth. These are the strongest rigorous statements available about the value of depth, and it is worth being clear about their scope: they show depth can buy exponential efficiency on specially constructed functions. They do not show that the functions arising in practice have this character.
Backpropagation
Represent the network as a computational graph: nodes are intermediate values, edges are elementary operations. For a feedforward net,
with scalar loss .
Define the adjoints . Then
and
These are exact derivatives (no finite differences), computed in time and memory .
Key idea
Backpropagation is not an algorithm specific to neural networks and it is not an approximation. It is reverse-mode automatic differentiation applied to a particular graph, and the reason it is cheap is the one on the matrix calculus page: many inputs, one output, so accumulate the Jacobian product from the left. The "many parameters, one loss" shape of deep learning is what makes it affordable, and the memory cost of storing activations is the price.
With , the input-layer adjoint is
so
and generically for the typical singular value. The gradient is therefore exponential in depth, vanishing for and exploding for .
Problems
XOR is not linearly separableProof · Foundation · 15 min Derive the backpropagation recursionProof · Intermediate · 30 min Width needed to represent a piecewise linear functionProof · Advanced · 1 hour Gradient magnitude through a deep chainProof · Intermediate · 30 min Implement backpropagation from scratchCoding · Intermediate · 3 hoursReferences
- PaperGeorge Cybenko (1989). Approximation by superpositions of a sigmoidal function
- PaperKurt Hornik (1991). Approximation capabilities of multilayer feedforward networks
- PaperMoshe Leshno, Vladimir Ya. Lin, Allan Pinkus and Shimon Schocken (1993). Multilayer feedforward networks with a nonpolynomial activation function can approximate any function
- PaperMatus Telgarsky (2016). Benefits of depth in neural networks
- PaperRonen Eldan and Ohad Shamir (2016). The Power of Depth for Feedforward Neural Networks
- PaperDavid E. Rumelhart, Geoffrey E. Hinton and Ronald J. Williams (1986). Learning representations by back-propagating errors
- BookIan Goodfellow, Yoshua Bengio and Aaron Courville (2016). Deep Learning
These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.
Results stated on this page
- PropositionA single linear threshold unit cannot represent XORproof includedThe classic separability obstruction, and the exact reason a hidden layer is needed.
- TheoremUniversal approximation theoremOne hidden layer with a non-polynomial activation approximates any continuous function on a compact set uniformly.
- PropositionWhat universal approximation does not giveproof includedIt is a density statement with no bound on width, no learning algorithm and no sample complexity.
- TheoremDepth separationThere are functions expressible by a small three-layer network that require exponential width at two layers.
- TheoremBackpropagation computes the exact gradientproof includedReverse accumulation on a computational graph returns the exact derivative, not an approximation, in time proportional to the forward pass.
- PropositionGradient magnitude through a deep chainproof includedThe gradient is a product of layer Jacobians, so its norm is governed by a product of singular values and is generically exponential in depth.
Problems (5)
All problems- Derive the backpropagation recursionProofIntermediate⏱ 30 min
- Implement backpropagation from scratchCodingIntermediate⏱ 3 hours
- Gradient magnitude through a deep chainProofIntermediate⏱ 30 min
- Width needed to represent a piecewise linear functionProofAdvanced⏱ 1 hour
- XOR is not linearly separableProofFoundation⏱ 15 min
Papers that use this mathematics
ImageNet Classification with Deep Convolutional Neural Networks
Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton · 2012
Deep Residual Learning for Image Recognition
Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun · 2016
Dropout: A Simple Way to Prevent Neural Networks from Overfitting
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, Ruslan Salakhutdinov · 2014
Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift
Sergey Ioffe, Christian Szegedy · 2015
Denoising Diffusion Probabilistic Models
Jonathan Ho, Ajay Jain, Pieter Abbeel · 2020
The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks
Jonathan Frankle, Michael Carbin · 2019
Auto-Encoding Variational Bayes
Diederik P. Kingma, Max Welling · 2014
Generative Adversarial Nets
Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, Yoshua Bengio · 2014