How AI Makes a Decision
Say you want to go to the park today. What goes through your head? You weigh a few things up and come to an answer. A perceptron — a single node of a neural network — does exactly that, with numbers.
1Start with the factors
Most of us would rather not get soaked. So the questions you might ask are:
- Do I have a jacket?
- Do I have an umbrella?
- Is it sunny now?
- What is the weather forecast for later?
These are the inputs. Each answer is yes or no, and we write yes as 1 and no as 0.
2Not all factors are equal
Some of those matter more than others. For most people is it sunny now counts for more than the forecast for later, and having a jacket counts for more than having an umbrella. That ranking is turned into numbers called weights.
3The bias
A cautious person sets a bias weight that pulls hard toward staying indoors, so they only go out when they are fairly sure it will not rain. A daring person sets a smaller one and goes out almost regardless. Here we are being cautious, so the bias weight is −4.
4What a minus sign means
That bias weight is negative, and the minus sign is doing real work. A weight can point either way:
- A positive weight argues for the answer being yes. Sunny now has a weight of 3, so when it is sunny it adds 3 to the total and pushes you towards going.
- A negative weight argues against it. It subtracts from the total and pushes you towards staying in.
5Add it all up
Multiply each input by its weight, add the bias term, and compare the total with the threshold, which is 0. Above the threshold, you go.
If y is above the threshold, the perceptron fires and the answer is yes. Otherwise it is no.
Flip the answers and watch the total move. The decision changes the moment the total crosses zero.
An input that is 0 contributes nothing, however heavy its weight — that is the step most marks are lost on. The bias weight is negative: it pulls towards stay at home, and because the bias input is always 1, that pull is applied every single time before any fact is counted.Originally written as “go if the total is greater than 1.0” with no bias. That is the same machine as the bias of −1 shown here with a threshold of 0 — and the board asks it in the bias form.
The cricket example above is written both ways: its bias of −1 is the same rule as “fire above 1.0”. Answer in the bias form, because that is the form the board prints.
No jacket, I have an umbrella, not sunny, forecast ok. The total comes to −0.5. That is below 0, so: stay in.
Try both in the widget above.
A pair of scales
6Why people disagree
There is no correct set of weights. Two people looking at exactly the same sky can pick different weights and a different bias, and so reach different decisions. That is the whole reason everyone does not do the same thing on the same morning — and it is also why two AI models trained differently can disagree about the same data.
7From the board papers
▶Show the answer
The method, which is what you are being marked on: multiply each attribute’s value x by its weight w, leaving out any whose x is 0, add those products together, then add the bias — here 1 × 0.3 = 0.3. The sum is y. Add the bias exactly once, and never multiply it by anything but 1.
▶Show the answer
Draw four inputs x₁ … x₄, one per factor, each answered 1 for yes and 0 for no. Give each a weight w₁ … w₄ according to how much the manager thinks it matters — company policy would normally be the heaviest, since nothing else counts if the policy forbids it. Add a bias input fixed at 1 with its own weight, standing for how willing this manager is in general. Sum w₁x₁ + w₂x₂ + w₃x₃ + w₄x₄ + (1 × b) and compare with the threshold: above it, the request is approved.
There is no single correct set of weights — a different manager would choose different ones, and that is the point.
8Check yourself
In a perceptron, what does a weight represent?
What value is the bias input always given?
Is there a single correct set of weights for a perceptron?
An input answered 'no' contributes what to the sum?