Specialty Digest

Global English editionLearners’ Study Dashboard — in development
The Knowledge Library for All

Flashcards: open the module flashcards (end-of-module review with workplace questions).

Online Courses / University Track / Neural Networks and Deep Learning

Module 1 · Lesson 2 · Core

The artificial neuron: weighted sum and bias

Compute the total a neuron forms from its inputs, weights and bias.

  • 50 minutes
  • Serves O1
  • Assumes M1.L1

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.

InputValueWeightInput × weight
Distance (km)20.51.0
Parcels30.41.2
Bias–11.0
Total z3.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.

  1. 4 × 0.25 = 1. (1 mark)
  2. 1 × (−1) = −1, and 2 × 0.5 = 1. (1 mark)
  3. Sum of products: 1 − 1 + 1 = 1. (1 mark)
  4. Add the bias: z = 1 + 0.5 = 1.5. (1 mark)

Go deeper: the professor's notes

A neuron multiplies each input by its weight, adds the products and then adds a bias. The result is the total z, the neuron’s raw signal.
Weight

Sets how strongly an input counts, and in which direction.

Bias

A starting value added whatever the inputs are.

Total z

w1x1 + w2x2 + … + b.

Multiplyeach inputAddthe productsAddthe biasTotalz
Forming the total

Worked total for one delivery

InputValueWeightProduct
Distance (km)20.51.0
Parcels30.41.2
Bias1.0
Total z3.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.

  1. Multiply: 4 × 0.25 = 1, 1 × (−1) = −1, 2 × 0.5 = 1.
  2. Add the products: 1 − 1 + 1 = 1.
  3. Add the bias: 1 + 0.5 = 1.5.
  4. 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:

2. A negative weight on an input means that input:

3. Inputs 2 and 3, weights 0.5 and 0.4, bias 1 give z =

4. Inputs 1 and 2, weights 3 and −1, bias 0.5 give z =

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

MistakeWhy it fails
Adding the weights instead of multiplying them by the inputsMultiply first, then add.
Forgetting the biasAdd it once at the end.
Dropping a minus signCheck 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?
Inputsall zeroProductsall zerozequals bias
The bias is a baseline added to every case.

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?
2 km× 0.5 = 1.02000 m× 0.5 = 1000Checkunits match
The model sees numbers, not units.

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?
Layer 1× 2Layer 2× 3Together× 6 only
Without activations, depth adds nothing.

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?
z = −40z = 00z = 33
ReLU blocks negatives and passes positives.

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.

Review with flashcards

Test yourself on this module with workplace flashcards and detailed answers.

Open the module flashcards