Phase 1: Prepare
Step 1 Warm-up recall
From M1.L1: what are the parameters of a network?
Private: nothing you type here is sent or stored.
Step 2 Learning goal
By the end of this lesson you can:
- state the weighted-sum rule (Foundation);
- calculate z for given inputs, weights and bias (Core);
- explain what a bigger weight means (Core).
Phase 2: Teach
Step 3 A familiar example
A household budget gives each cost a different importance: rent counts more than coffee. A neuron does the same with its inputs by giving each a weight.
Step 4 Clear explanation
A neuron forms a total z by multiplying each input by its weight, adding the results and then adding a bias: z = w1×x1 + w2×x2 + … + b. A large positive weight means the input pushes the total up strongly; a negative weight pushes it down; a weight near zero means the input is nearly ignored. The bias shifts the total up or down whatever the inputs are, like a starting value.
| Input | Value | Weight | Input × weight |
|---|---|---|---|
| Distance (km) | 2 | 0.5 | 1.0 |
| Parcels | 3 | 0.4 | 1.2 |
| Bias | – | 1 | 1.0 |
| Total z | 3.2 |
With distance 2 km, 3 parcels, weights 0.5 and 0.4 and bias 1, the total is 2×0.5 + 3×0.4 + 1 = 3.2. The total is then passed to an activation, the subject of the next lesson. For the structure of such models in general, see neural network.
Step 5 Worked example (4 marks)
A neuron has inputs 4, 1 and 2, weights 0.25, −1 and 0.5, and bias 0.5. Find z.
- 4 × 0.25 = 1. (1 mark)
- 1 × (−1) = −1, and 2 × 0.5 = 1. (1 mark)
- Sum of products: 1 − 1 + 1 = 1. (1 mark)
- Add the bias: z = 1 + 0.5 = 1.5. (1 mark)
Go deeper: the professor's notes
Sets how strongly an input counts, and in which direction.
A starting value added whatever the inputs are.
w1x1 + w2x2 + … + b.
Worked total for one delivery
| Input | Value | Weight | Product |
|---|---|---|---|
| Distance (km) | 2 | 0.5 | 1.0 |
| Parcels | 3 | 0.4 | 1.2 |
| Bias | 1.0 | ||
| Total z | 3.2 |
At work: Checking a colleague’s figure
Illustrative: a colleague reports z = 5.2 for inputs 4, 1 and 2 with weights 0.25, −1 and 0.5 and bias 0.5.
- Multiply: 4 × 0.25 = 1, 1 × (−1) = −1, 2 × 0.5 = 1.
- Add the products: 1 − 1 + 1 = 1.
- Add the bias: 1 + 0.5 = 1.5.
- Compare with the reported 5.2.
What a careful practitioner decides. The correct total is 1.5, so ask for the working before the figure is used anywhere.
Phase 3: Practise
Step 6 Learner practice (instant-marked)
1. The weighted-sum rule is:
z = w1x1 + w2x2 + … + b.
2. A negative weight on an input means that input:
Larger inputs lower z.
3. Inputs 2 and 3, weights 0.5 and 0.4, bias 1 give z =
1.0 + 1.2 + 1.
4. Inputs 1 and 2, weights 3 and −1, bias 0.5 give z =
3 − 2 + 0.5.
Phase 4: Close
Step 7 Recap
- z = sum of (weight × input) + bias.
- A weight near zero means the input is nearly ignored.
- The bias shifts the total regardless of the inputs.
Step 8 Exit ticket (ungraded)
Compute z for inputs 5 and 2, weights 0.2 and 0.5, bias −1.
Private: nothing you type here is sent or stored.
Step 9 Go further (Extension)
Invent two inputs for a workplace estimate, give each a weight with a reason, and compute z.
In industry: The Mark I Perceptron, 1960
Frank Rosenblatt’s team at the Cornell Aeronautical Laboratory built the Mark I Perceptron with funding from the US Office of Naval Research. It had a 20 × 20 grid of 400 photocells as its eye, 512 association units and 8 response units. The adjustable weights were stored in potentiometers, and electric motors turned them when the machine gave a wrong answer. The machine is now held by the Smithsonian.
Link to this lesson. A weight is a number that sets how strongly an input counts. Here it was a physical dial, adjusted from examples.
Source: Smithsonian National Museum of American History; Cornell Aeronautical Laboratory, Mark I Perceptron Operators’ Manual (1960)
Common mistakes
| Mistake | Why it fails |
|---|---|
| Adding the weights instead of multiplying them by the inputs | Multiply first, then add. |
| Forgetting the bias | Add it once at the end. |
| Dropping a minus sign | Check the sign of every weight. |
Limits. Weights here are chosen for the exercise; in practice they are learned from data.
Flashcards for this lesson (4)
Tap a card to reveal the answer. Read the question, answer it aloud or in writing first, then check yourself against the explanation.
Card 1 of 4 · What does the bias do, and what is z when every input is zero?
The bias is a number added to the total whatever the inputs are, so it shifts the neuron’s starting point. If every input is zero, every product is zero and z equals the bias. Without a bias, a neuron fed zeros could only ever output zero before activation.
At work: think of the fixed handling time that every delivery needs before distance or parcels are counted; the bias plays that role.
Card 2 of 4 · A model receives distance in kilometres in one test and in metres in another, with the same weight of 0.5. What happens, and why does it matter?
For 2 km the product is 2 × 0.5 = 1.0. For 2000 m it is 2000 × 0.5 = 1000, which swamps every other input. A neuron has no knowledge of units, so the numbers it receives must be on the scale it was trained on. For this reason inputs are usually scaled to a common range before training.
At work: before feeding new data to an existing model, confirm that units, currencies and date formats match those of its training data.
Card 3 of 4 · Why does a network need activation functions at all? Why not just add weighted sums layer after layer?
Because chained weighted sums collapse into one. If one layer doubles its input and the next triples it, the pair together simply multiplies by 6, which a single weight could do. A non-linear activation between layers stops this collapse and lets depth build patterns that one weighted sum cannot represent.
At work: this is why “more layers” is not a free improvement: the layers must include activations, and each one adds parameters to learn and to test.
Card 4 of 4 · Apply ReLU to the totals −4, 0 and 3. What are the outputs, and what rule did you use?
ReLU gives max(0, z): −4 becomes 0, 0 stays 0 and 3 stays 3. It blocks negative totals and passes positive ones unchanged. Because of its simplicity and good training behaviour it is the usual choice for hidden layers.
At work: a ReLU neuron that gives 0 is not broken; it is saying that its weighted evidence for its pattern was not positive in that case.