Neuron Lab
Inside a neural network, one neuron at a time
Your mission
Neural networks are built from tiny units called artificial neurons. Take one apart, run the lecture's video example, tune its weights and bias until it behaves like an AND or OR gate, watch it learn its own weights, and see why deep networks need many layers and fast GPUs.
Explore
Tap each part of the neuron, run the calculation, and compare it with a brain neuron.
The lecture's example: will this user engage with a video? x₁ = 1: the video matches the user's interests. x₂ = 1: the user has previously enjoyed videos from this creator.
Tap each part of the neuron, then press Calculate.
An artificial neuron receives numerical inputs, applies weights, adds a bias, and produces an output. Thousands of these, connected in layers, make up a neural network. Tap each glowing part to find out what it does.
0 of 7 discoveries made
Experiment
Tune the weights and bias, train the neuron to learn its own weights, and send a photo through a deep network.
w₁ = −0.4 · w₂ = 0.2 · b = 0.3
The neuron starts with poor weights. Each training step: predict, compare with the target, measure the error, adjust the weights and bias.
Why many layers?
Why GPUs?
Neuron experiments
Try each one. They tick themselves off.
0 of 6 experiments done
Challenge
Six signals: calculate z and y, order the training steps, and name the parts of a network.
Neuron notes
- z = w₁x₁ + w₂x₂ + b
- Threshold: y = 1 if z > 0, otherwise y = 0
- Weight: how strongly an input affects the result
- Bias: a constant that shifts the result
- Input layer → hidden layers → output layer
Finish all 6 signals to finish this stage.
Understand
Here is what the neuron was showing you, in the words you need for the exam.
From biological to artificial neurons
The brain contains biological neurons that communicate through electrical and chemical signals. Artificial neural networks are loosely inspired by this idea of interconnected information-processing units.
| Biological nervous system | Artificial neural network |
|---|---|
| Biological neurons | Mathematical computing units |
| Connections between neurons | Weighted connections |
| Biological adaptation | Adjustment of model parameters |
| Neural signalling | Numerical calculations |
Important: artificial neurons are simplified mathematical models. They do not reproduce the full biological complexity of real neurons.
How a single neuron works
An artificial neuron receives numerical inputs (x₁, x₂), multiplies each by a weight (w₁, w₂), adds a bias (b) and gets the weighted sum z = w₁x₁ + w₂x₂ + b. An activation function turns z into the output y.
With a threshold activation: y = 1 if z > 0, and y = 0 if z ≤ 0. Real networks often use other activation functions, such as sigmoid or ReLU.
The worked example
Inputs x₁ = 1, x₂ = 1; parameters w₁ = 0.7, w₂ = 0.6, b = −0.8.
Step 1: z = (0.7 × 1) + (0.6 × 1) − 0.8 = 0.7 + 0.6 − 0.8 = 0.5.
Step 2: z > 0, so y = 1: the model predicts the user will engage with the video.
Weights, bias and activation
- Weight: controls how strongly an input affects the result.
- Bias: a constant that shifts the decision boundary.
- Activation function: converts the combined input z into an output y (e.g. 0 or 1).
The structure of a network
- Input layer: receives numerical data.
- Hidden layers (one or more): transform the data through mathematical calculations.
- Output layer: produces a prediction or other output.
Information moves through connected layers, with each neuron performing mathematical operations.
How does a network learn its weights?
During training, a neural network learns useful weight values by adjusting its parameters to reduce prediction errors:
- 1Initialise the weights and biases.
- 2Generate predictions from training examples.
- 3Measure the difference between the predictions and the correct targets.
- 4Adjust the weights and biases.
- 5Repeat across many training examples.
Two important techniques: backpropagation determines how the model's parameters affect the loss, and gradient descent uses this information to update the parameters toward lower loss. (The game used a simpler update rule for a single neuron, but the idea is the same: nudge the numbers to reduce the error.)
Why many layers?
Some problems are too complex for a single neuron. Deep neural networks use multiple layers to learn increasingly useful representations: the image is represented as numerical pixel values, early layers learn simple visual features such as edges and textures, deeper layers combine them into more complex patterns, and the output layer produces a prediction such as "Cat".
Why GPUs?
Training and running large AI models can require enormous numbers of numerical operations. A CPU is designed for flexible, general-purpose computing. A GPU is designed to perform many similar calculations in parallel, and is particularly effective for the matrix operations used in neural networks. AI still depends on computer architecture, processors, memory and digital data (Unit 1).
Words to know
- Artificial neuron
- A mathematical unit: weighted sum of inputs plus bias, then an activation function.
- Weight
- Controls how strongly an input affects the result.
- Bias
- A constant that shifts the result (the decision boundary).
- Activation function
- Converts the weighted sum z into the neuron's output.
- Hidden layer
- A layer between input and output that transforms the data.
- Backpropagation
- Works out how each parameter affected the loss.
- Gradient descent
- Updates the parameters in the direction of lower loss.
- GPU
- A processor that performs many similar calculations in parallel.
Exam tip
For a neuron calculation, write it in two steps, exactly like the lecture: Step 1 the weighted sum with the numbers substituted, z = (w₁ × x₁) + (w₂ × x₂) + b; Step 2 apply the activation function and state y. Watch the sign of the bias, and remember that with the threshold rule z = 0 gives y = 0.