3.1 Neural networks: the intuition

Week 3
Pick a depth · ✨ generates it for this lecture

Neural networks: the intuition

The engine behind almost all of today's AI is the neural network. The name invokes the brain, and the loose inspiration is real, but it is best understood not as a digital brain but as a particular, very flexible kind of mathematical function.

Neurons

The basic unit is an artificial neuron. It does something simple: it takes several numbers as input, multiplies each by a weight, adds them up, and passes the result through a simple nonlinear step that decides how strongly to "fire." One neuron alone is nearly trivial — it draws a single straight dividing line through its inputs.

Layers

Power comes from connecting many neurons into layers, with the outputs of one layer feeding the inputs of the next. The first layer reads the raw input; the last layer produces the output; the layers in between (the hidden layers) transform the data step by step. Stacking layers lets the network combine many simple decisions into one enormously complex one — bending and folding the input space until even tangled patterns become separable.

Weights are what is learned

The weights — the numbers multiplying each connection — are exactly the parameters from week 1 that training adjusts. A fresh network has random weights and is useless; training tunes millions or billions of them until the whole network computes a useful input-to-output mapping. The architecture (how neurons are wired) is designed by humans; the weights are learned from data.

Why they are powerful

Mathematically, a network with enough neurons can approximate essentially any input-output relationship — it is a universal approximator. That flexibility is the source of both its strength (it can model almost anything) and its difficulty (it needs lots of data and care to find the right weights without overfitting).

A worked example

To recognize a handwritten digit, the input layer reads the pixel brightnesses. Hidden layers progressively combine pixels into strokes and strokes into digit-shaped patterns. The output layer has ten neurons, one per digit, and the one that fires most strongly is the network's guess. Nobody programmed "a 7 has a horizontal top and a diagonal stroke"; the weights that encode this were learned from thousands of examples.

Tip: highlight any passage above to ask the tutor about it, or to generate practice problems specifically on what you selected.
Ask the tutor for an explanation, a worked example, or a hint. Highlight a passage on the left to ground the question in that text.