Neural Networks
Neural networks are parametric function approximators built from layered compositions of weighted sums and nonlinear activation functions, trained by gradient descent on a loss function. Key result: a feedforward network with a single sufficiently large hidden layer can approximate any continuous function on a compact set to arbitrary accuracy (Universal Approximation). Applies in: machine learning, computer vision, natural language processing, function approximation, control. Who/when: McCulloch & Pitts (1943), Rosenblatt (1958), Rumelhart–Hinton–Williams backpropagation (1986), deep learning revival (2006–2012).
A single neuron computes a linear decision boundary; it cannot represent nonlinearly separable patterns (e.g., XOR). But if you feed the outputs of many neurons into another layer of neurons, the composition of affine maps and nonlinearities becomes a universal building block. Depth and nonlinearity together convert a limited linear model into a representation that can bend, fold, and carve the input space arbitrarily. Crucially, the whole composite remains differentiable in its parameters, so the gradient of any scalar loss can be computed efficiently by reverse-mode differentiation.
Formal Statement
A single neuron with input , weight vector , bias , and activation function computes:
Derivation hint: model the biological neuron's "weighted summation of inputs followed by a threshold firing rule"; replace the hard threshold with a smooth for differentiability. Here is the pre-activation (or logit), and is the activation (output). The bias shifts the decision boundary away from the origin.
A network of layers maps input through layers indexed . Let be the weight matrix and the bias of layer . Then:
Derivation hint: stack neurons of form [1] into one layer; each row of is one neuron's weight vector, and is applied elementwise. The full network is the composition where , and .
Derivation hint: sigmoid is the logistic CDF squashing ; is a rescaled sigmoid; ReLU is the simplest piecewise-linear nonlinearity, .
For supervised learning with targets , common losses for a dataset of examples are mean squared error (regression) and cross-entropy (classification):
Derivation hint: MSE is the negative log-likelihood under a Gaussian noise model; cross-entropy is the negative log-likelihood under a categorical (softmax) model. The softmax output converts logits into a probability vector: .
Let be a continuous, non-constant, bounded function (e.g. sigmoid). For any continuous function on a compact set and any , there exist , weights , biases , and coefficients such that:
Derivation hint: the set of single-hidden-layer functions is dense in ; Cybenko's proof uses the Hahn–Banach theorem and discriminatory property of to show no nonzero signed measure annihilates this set. That is, a single hidden layer of unbounded width can approximate any continuous function uniformly on compacts. Width may be exponential; depth can give exponentially more efficient representations.
Why It Holds / Derivation
The defining algorithm is backpropagation — efficient computation of by the chain rule.
Goal: compute and for all layers.
Step 1 — Define the error signal. Let , the sensitivity of the loss to the pre-activation of neuron in layer . Collect into .
Step 2 — Output layer. By the chain rule through :
Derivation hint: ; the second factor is ; is elementwise product.
Step 3 — Recursive backward pass. Since and :
Derivation hint: apply the multivariable chain rule ; the first partial is .
Step 4 — Parameter gradients. Since depends on through :
Derivation hint: and ; multiply by .
Step 5 — Cost. One forward pass plus one backward pass computes the entire gradient in time — the same order as evaluating the network itself.
∎Parameters are updated against the gradient with learning rate . Stochastic gradient descent (SGD) uses a minibatch :
Derivation hint: first-order Taylor expansion shows movement along decreases loss for small ; the minibatch estimate is an unbiased gradient estimator.
An American psychologist who, in 1958, built the Perceptron — both an algorithm and a physical machine (the Mark I Perceptron) with motor-driven potentiometers as adjustable weights, designed to recognize images. Rosenblatt proved the Perceptron Convergence Theorem: for linearly separable data, the simple update on misclassified points terminates in finitely many steps. His optimistic claims drew sharp criticism; Minsky and Papert's 1969 book Perceptrons showed single-layer perceptrons cannot compute XOR, contributing to the first "AI winter." Multilayer networks with backpropagation eventually vindicated the broader research program two decades later.
Building Intuition
Think of each neuron as drawing a hyperplane in input space and outputting "how far, and on which side" (softened by ). The first hidden layer carves space into linear regions; the second layer takes logical combinations of those regions (intersections via AND-like patterns, unions via OR-like patterns); deeper layers combine those into ever-more-elaborate shapes. With ReLU, the network is literally a continuous piecewise-linear function — the input space is partitioned into polytopes, and the network is affine on each. Depth multiplies the number of linear regions exponentially, which is why deep narrow networks can be vastly more expressive than shallow wide ones with the same parameter count. Training "bends" all these boundaries simultaneously by following the negative gradient downhill on the loss surface.
Worked Examples
Given: input , weights , bias , activation = sigmoid.
Step 1 — Pre-activation: .
Step 2 — Activation: .
Step 3 — Derivative (for later backprop): .
Given: the neuron above with output , target , MSE loss , learning rate .
Step 1 — Loss gradient w.r.t. output: .
Step 2 — Error signal: .
Step 3 — Weight gradients: ; ; .
Step 4 — Update [9]: ; ; .
Common Misconceptions
"More layers always help." Naïvely stacking layers can worsen training due to vanishing/exploding gradients: by [7], is repeatedly multiplied by and . With sigmoids (), the gradient shrinks geometrically with depth, so early layers barely learn. Remedies — ReLU activations, careful initialization (He/Xavier), batch normalization, and residual connections — were essential to make deep networks trainable. Depth without these tricks is often harder, not better.
"Universal approximation means networks can learn anything from data." Theorem [5] is purely about existence of weights, not learnability. It guarantees nothing about (a) finding those weights by gradient descent, (b) how many samples are required, or (c) generalization to unseen inputs. Approximation, optimization, and generalization are three separate problems.
The XOR function maps , , , . A single neuron computes , whose decision boundary is a single line. No line separates from — the positive and negative classes are interleaved at opposite corners. Resolution: one hidden layer of two neurons (e.g. computing OR and NAND) followed by an AND output neuron solves XOR exactly. This concrete failure of single-layer perceptrons, highlighted by Minsky–Papert (1969), motivated multilayer networks.
Connections
Neural networks sit at the intersection of several fields. The training objective and update rule come from Gradient Descent and Convex Optimization (though the landscape is non-convex). Backpropagation is exactly reverse-mode Automatic Differentiation applied to a computational graph. The cross-entropy loss and softmax derive from Maximum Likelihood Estimation under a categorical model, linking to Probability Theory. The single-neuron model with sigmoid is precisely Logistic Regression, so a network generalizes a stack of regressions. Universal approximation rests on density arguments from Functional Analysis (Hahn–Banach, Stone–Weierstrass). The matrix operations in [2] are Linear Algebra, and convolutional variants connect to Fourier Analysis and signal processing.
Real-World Applications
Historical Development
Subtleties & Limits
Despite practical success, deep learning's theory has large gaps. Why does SGD generalize? Overparameterized networks with more parameters than data points can fit random labels yet still generalize on real data, defying classical bias-variance intuition (the "double descent" phenomenon). Why is non-convex optimization easy? The loss surface has exponentially many saddle points and local minima, yet SGD reliably finds good solutions — partial explanations invoke the geometry of overparameterized landscapes and the "lottery ticket" hypothesis. Expressivity vs. trainability: depth gives exponential expressive power, but provably learnable function classes remain narrow. Robustness and interpretability: networks are vulnerable to imperceptible adversarial perturbations and remain largely black boxes. Sample/energy efficiency: humans learn from far fewer examples and far less energy than current models. These questions span optimization theory, statistical learning theory, and approximation theory.
See Also
Backpropagation · Automatic Differentiation · Universal Approximation Theorem · Stochastic Gradient Descent · Activation Functions · Deep Learning · Support Vector Machines