g↗genai/ learner
Neural Networks and Deep Learning / Lesson 01

Neurons, weights and biases

A neuron in a neural network is a small mathematical unit. It combines input numbers using weights and adds a bias; it is not a tiny brain.

Concept + interactive labBeginner friendly

A neuron is a calculation.

A neuron is a name for one calculation inside a neural network. It receives numbers called inputs— values supplied to a calculation—combines them, and returns a number. Connected neurons can form a larger network, but one neuron does not think or understand on its own.

This lesson follows four ideas in order: input signals, weights, a bias, then the score—the number the calculation returns.

A calculator with adjustable knobs

Imagine a small calculator that turns each clue up or down before adding them. The clue is an input; its knob is a weight. A separate starting amount is the bias. This is only a picture of the calculation—real neurons do not contain little knobs.

One common neural-network operation multiplies inputs by learned weights, adds the results, then adds a bias. For a single output, the shorthand is weighted inputs + bias = score. Frameworks such as PyTorch document the same operation in their linear layer. This lesson studies that calculation before any later processing.

The made-up umbrella example below previews the numbers: rain signal 1, dark-cloud signal 0, weights 2 and −1, and bias −1. The next sections work through each step.

Infographic: One neuron, one calculation. Weighted inputs + bias = score. Inputs × weights: Rain 1 × 2 = 2; Clouds 0 × −1 = 0. Add bias: 2 + 0 + (−1). Score: 1. Analogy: Each clue has a knob that changes its contribution. Key takeaways: ✓ Multiply each input by its weight; ✓ Add bias to the weighted inputs; ✓ The result is a score, not a thought.
The two input contributions are added with the bias to produce the score.

Inputs get multiplied by weights.

An input is a number supplied to the calculation. A weight is the number multiplied by that input. The product is that input’s contribution to the score: a larger positive weight pushes it up more, while a negative weight pushes it down.

Think of two clues for a made-up umbrella reminder: a rain signal and a dark-cloud signal. Each signal is a 0-or-1 number that marks whether that clue is off or on. In this tiny example, if rain is 1 and dark clouds are 0, with weights 2 and −1, their weighted inputs are 1 × 2 = 2 and 0 × −1 = 0. The rain clue contributes 2; the off cloud clue contributes 0.

1 rain2 weight2 contribution0 clouds−1 weight0 contribution
Each input follows its own multiplication before the results are added.

A weight changes how much its own input contributes. In a trained model, weights are values adjusted during training—the process of fitting a model to examples. This lesson will not show how those values are adjusted.

Bias shifts the starting score.

A bias is an added value in this calculation. It shifts the score even when the input signals are zero. With both umbrella signals off, both weighted inputs add to zero. A bias of −1 gives a score of −1; changing the bias to 0 gives a score of 0.

Weighted inputs: 0Bias: −1Starting score: −1
The bias is added after the weighted inputs.

The bias is like an initial amount added to the running total. That analogy is about addition only: it is not a fixed human preference or a guarantee about a model’s answer. Some calculation designs leave bias out, so this lesson shows one common form rather than claiming every neuron has a bias.

Change the weights.

Try each signal by itself, then turn both on. Change one weight at a time and watch only that input’s contribution change. With both signals off, move either weight: the score stays at the bias, −1.

  1. Start with rain on and dark clouds off; note the score.
  2. Move the rain weight from 2 down to 0, then reset.
  3. Turn rain off and dark clouds on; compare the score.
  4. Turn both on, then both off. With both off, change either weight.

Invented teaching example: these signals and numbers are made up. This is not a weather forecast or a live AI model.

Set the toy input signals

Each signal is 0 (off) or 1 (on).

Change each weight
1 rain2 weight
0 clouds-1 weight
Add both products and bias (-1)
Score1

1 × 2 + 0 × -1 + (-1) = 1

Toy reminder rule: show a reminder when the score is 0 or higher. Reminder on

Score 1. Reminder on.

What this tiny model can and cannot show.

This example uses a made-up score and a made-up cutoff: its reminder turns on at 0 or above. A real neural network may combine many inputs, calculate many outputs, and apply other operations after a weighted sum. The next lesson looks at layers (groups of units) and activation functions (rules applied to scores).

Quick questions

What changes when a weight changes? That input’s contribution changes; an input of 0 still contributes 0.

What can bias change when inputs are off? It sets the score because the weighted inputs then add to 0.

This single calculation is a useful building block, not a miniature mind. A network gets its behavior from many connected calculations and values working together.

✎ Try it yourselfKnowledge check · Practice only

Check your understanding.

Both toy signals are 0. Rain weight is 2, dark-cloud weight is −1, and bias is −1. The score is their weighted sum plus the bias. The reminder cutoff stays at 0. Which one edit changes the computed score?

Keep this model in mind.

A neuron combines weighted inputs, adds a bias, and returns a score. Changing a weight changes how strongly its input contributes; bias shifts the score independently of those inputs.