A neural network is built from one part repeated many times: a unit that multiplies each input by a weight, adds the results into a single number, and passes that number through a simple function. One such unit draws a straight line through the data and nothing more. The whole story of neural networks is what happens when you stack these units into layers, because the stack can represent shapes that no single unit ever could. That jump, from one line to arbitrary decision regions, is the foundation everything in deep learning stands on.

The idea

An artificial neural network is a layered composition of simple units. Each unit computes a weighted sum of its inputs, , then applies a nonlinear activation . A single unit is a linear classifier. Feeding the outputs of one layer into the next builds a function that can approximate essentially any input-output mapping, which is what makes networks worth the trouble.

The Unit

Start with the simplest version, the linear unit. It outputs , a plain weighted sum plus a bias. The weight vector (a vector, in the sense of linear-algebra-fundamentals) is the parameter set, and every choice of is a different hypothesis. A common trick fixes a dummy input so the bias becomes just another weight , and the whole thing collapses to .

Add a threshold and you get the linear threshold unit, the classic perceptron: output if and otherwise. Frank Rosenblatt introduced the perceptron in a 1958 paper and built the Mark I Perceptron, a physical machine designed for image recognition, first demonstrated publicly in 1960. The weighted sum defines a hyperplane, and the unit reports which side of it an input falls on.

A perceptron unit: inputs times weights, summed, then passed through an activation to produce an output

What One Unit Can and Cannot Do

Because a threshold unit is a hyperplane, it can only separate classes that a hyperplane can separate. Those are the linearly separable problems. Logical AND is one of them: with , , and , the unit fires only when both inputs are 1, which is exactly AND. Plenty of useful functions have this form.

XOR does not. No single straight line puts and on one side and and on the other. Marvin Minsky and Seymour Papert made this limitation precise in their 1969 book Perceptrons, and the result stalled neural network research for years. The lesson was not that the perceptron was useless, but that a single unit is fundamentally too weak, so you need networks of units.

Training a single perceptron is simple. The perceptron training rule nudges each weight toward reducing the error on the current example:

where is a small learning rate. If the true label exceeds the prediction, push the weights up along , otherwise push them down. This rule is guaranteed to converge to a separating hyperplane, but only if the data is linearly separable and is small enough. On XOR it never settles, because no solution exists for it to find.

Stacking Units Into Layers

The way out of the XOR trap is to add a layer. Take two threshold units that each draw a line, and use their outputs as new coordinates . In that new space the points that were tangled together become linearly separable, and a third unit can finish the job with a single hyperplane. The hidden layer has remapped the inputs into a representation where the problem is easy.

This is a two-layer feedforward network, also called a multilayer perceptron. Signals flow one direction, from inputs through one or more hidden layers to the outputs, with no loops. Each hidden unit learns a feature, and later layers combine features into more useful features. That composition of simple functions is precisely the mechanism the deep-learning-revolution scaled up: with two hidden layers of threshold units you can carve out any union of intersections of halfspaces, which covers arbitrarily complicated decision regions.

What Networks Can Represent

The theoretical backing is the universal approximation theorem. George Cybenko proved in 1989 that a feedforward network with a single hidden layer of sigmoidal units can approximate any continuous function on a bounded domain to any desired accuracy. Kurt Hornik sharpened this in 1991, showing the power comes from the multilayer architecture itself rather than the specific activation function chosen.

Read that result carefully, because it is easy to oversell. It is an existence theorem. It promises that a network with the right weights exists, but says nothing about how to find those weights (that job belongs to backpropagation and gradient-descent), and it may demand an impractically large hidden layer. A network that can represent a function is not the same as one you can train to compute it, and a big enough network can also overfit, which is why regularization matters. Representational power is the license to try, not a guarantee of success.

Example

Build AND as a single threshold unit with weights , , bias , firing when .

output
000
010
100
111

One line does AND perfectly. Try the same for XOR and you will fail: the four points cannot be split by any single line, so XOR needs a hidden layer to first remap the inputs into a separable space.

Sources