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.

Not startedJump to quiz

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

. Pre-activation ; bias = weight on a constant input 1.

See every cheatsheet by category →

Check your understanding

Score 75% or more to master this lesson and earn XP. Answer first, then check.

Q1calculateA neuron has , and input . What is its pre-activation ?
Q2calculateThe same neuron (pre-activation ) uses a ReLU activation. What does it output?
Q3conceptWhat does the bias of a neuron do?
Q4interpretOne input of a trained neuron has weight ; another has weight . What do these tell you?
Q5conceptWhy can the bias be written as an extra weight ?