Lesson 2.1 · 6 min read · about 50 min to master at a very slow pace
The Artificial Neuron
A neuron computes a weighted sum of its inputs, adds a bias and applies an activation function. What each part does, a worked example, and why the bias is just a weight on a constant input.
What a neuron computes
- : the input vector (the features).
- : the weights, one per input.
- : the bias.
- : the pre-activation, a single number.
- : the activation function, which turns into the output .
So a neuron does two things: a weighted vote of its inputs, then a (usually non-linear) squashing of that vote.
What weights and bias mean
A positive weight means "more of this input pushes the output up"; a negative weight pushes it down; a weight near zero means the input barely matters. The bias shifts the threshold independently of the inputs: a large negative bias makes the neuron hard to switch on.
The bias can be treated as one more weight, , on a constant input . Then , which is why some books write the neuron without a separate bias.
Worked example
, , .
.
- Sigmoid: .
- ReLU: .
- Sign: .
Same pre-activation, three different outputs: the activation function decides how the neuron responds.
Stuck? Common doubts
Questions real learners asked while studying this lesson. They stay closed so they don't spoil your own thinking: open only the ones you need.
First passWhy do we need a bias at all?
Without a bias, is always 0 when , so the decision boundary must pass through the origin. The bias lets the boundary sit anywhere. In one dimension it's the difference between a line through the origin, , and any line, .
First passIs it still a neuron if it has no activation function?
Yes. A neuron with no activation is said to use the identity (or linear) activation, : it outputs its weighted sum plus bias unchanged. Output neurons for regression are usually like this. Linear regression is exactly one such neuron.
Going deeperCan a neuron have more than one activation function?
In the standard model, no: a neuron computes one weighted sum and applies one activation to it. If you applied two functions one after the other, that composition is just a single, different activation function. Different neurons can use different activations, though, and a layer's output can go through extra operations such as softmax or normalisation.
Going deeperCan a neuron contain another neuron inside it?
No. A neuron is the smallest unit: a weighted sum, a bias and an activation. Structure comes from connecting neurons: the outputs of one layer become the inputs of the next. When a "neuron" seems to hide something more complex, it is really a small network of neurons.
Cheatsheet
The neuron
Check your understanding
Score 75% or more to master this lesson and earn XP. Answer first, then check.