Neural networks

A neural network is made of many tiny maths units called neurons, arranged in layers. Each connection has a weight: how much one neuron listens to another. The input layer takes in the data, hidden layers find patterns, and the output layer gives the answer.

Everyday analogy

A group of friends deciding whether a photo shows a cat. One notices whiskers, one notices pointy ears, one notices a tail. Each passes their opinion forward, and the friends trust some opinions more than others (the weights). Training teaches them whose opinion to trust more.

Example

Recognising a handwritten number: the input layer reads the pixels, hidden layers spot lines and curves, and the output layer says "this is a 7".

InputHidden layersOutput
Signals flow from inputs through hidden layers to an answer; training adjusts the strength of every connection.

A simple neural network

How a neural network learns

1. GuessData goes through the layers and the network makes a guess
→
2. CheckThe guess is compared with the right answer to measure the error
→
3. AdjustWeights are nudged to reduce the error (called backpropagation)
↻
4. RepeatMillions of times, until the guesses are good

Try it yourself

About 10 min

Do one neuron by hand

  1. Decide whether to go for a walk using three inputs: sunny (1 or 0), free time (1 or 0), tired (1 or 0).
  2. Give each a weight, e.g. sunny = 2, free time = 3, tired = -4. Multiply and add them up.
  3. If the total is above 2, the answer is go. Try different days and change the weights.

What you should see: Changing the weights changes the decision. Training a network is simply finding good weights.

Use any free AI chatbot (ChatGPT, Claude, Gemini or Copilot). Never paste private or confidential information.

Build it for real · guided projectTeach a neural network to read handwritingAbout 60 min · Copy-paste code · step by step
Test what you learned

Take a quick quiz, or look up any word in the glossary.