Formula Bro

Math and physics formulas, explained like you are new.


Artificial Neuron (Weighted Sum)

In one sentence: An artificial neuron multiplies each input by a weight, adds them up with a bias, and then decides how strongly to fire.

z=∑i=1nwixi+b,a=f(z)z = \sum_{i=1}^{n} w_i x_i + b, \quad a = f(z)

Read it out loud: “z equals the sum, for i from 1 to n, of weight i times input i, plus the bias b. Then the output a equals f of z, where f is the activation function.”

What each symbol means

SymbolMeaning

xix_i

One input number, for example a pixel brightness or a sensor reading. The neuron has nn inputs in total.

wiw_i

The weight for input ii. A large positive weight pushes the neuron toward firing, and a negative weight pushes against it. Training is the process that adjusts the weights.

ii

The position of one input in the list, counting from 1 up to nn.

nn

How many inputs the neuron has.

bb

The bias, one extra number added at the end. It shifts the threshold up or down, so the neuron can fire or stay quiet no matter what the inputs are.

∑i=1n\sum_{i=1}^{n}

“Add up for every ii from 1 to nn”: multiply each input by its weight and total all the results.

zz

The weighted sum plus the bias: the raw total before the activation function is applied.

ff

The activation function, a rule that turns the total zz into the final output. Two common examples are ReLU and the sigmoid.

aa

The output of the neuron, also called its activation. It is the number passed on to the next layer.

What the formula is doing

In machine learning, an artificial neuron is a small function. It takes a list of numbers x1,…,xnx_1, \dots, x_n as inputs. Each input comes with a weight wiw_i, a number that says how much that input matters. Large weights matter a lot, and negative weights work against the output.

The first step is the weighted sum. Multiply each input by its weight, add all the products together, and then add the bias bb. The bias is one extra number that is not tied to any input. The result is zz, the raw total. Nothing has been clipped or squashed yet.

The second step is the activation function ff. It takes zz and turns it into the output a=f(z)a = f(z). Without this step, a neuron would only compute a straight-line rule, and stacking many such neurons would still give a straight-line rule. The activation function adds the bend that lets networks learn patterns that are not straight lines.

Training is the process of finding good values for the weights and the bias. The formula itself does not change. Only those numbers do. Gradient descent is one common way to adjust them.

An everyday picture

Think of a voter weighing several opinions. Each friend’s advice counts for a different amount: a trusted friend counts a lot, and a friend who is usually wrong counts for less. The voter adds up the weighted opinions, adds a personal tilt for or against the idea, and then decides whether the total is enough to say yes. The decision step plays the role of the activation function.

Worked example: One neuron with two inputs

Two inputs x=(2,3)x = (2, 3) with weights w=(0.5,−1)w = (0.5, -1) and bias b=1b = 1. The activation function is ReLU, which returns max⁡(0,z)\max(0, z): a negative total becomes 0, and a positive total passes through unchanged. All values are unitless in this example.

  1. Multiply each input by its weight: 0.5×2=10.5 \times 2 = 1 and (−1)×3=−3(-1) \times 3 = -3.
  2. Add the products and the bias: z=1+(−3)+1=−1z = 1 + (-3) + 1 = -1.
  3. Apply ReLU: a=max⁡(0,−1)=0a = \max(0, -1) = 0.

Answer: The neuron outputs 0. Its weighted total was negative, so ReLU silenced it. A negative total always becomes 0 under ReLU, and only a positive total gets through.

The numbers in this example are recomputed by script every time the site is built.

Common mistakes

Where you will meet it

Questions people ask

Is an artificial neuron the same as a real brain cell?

No. It borrows the idea of inputs that add up toward a threshold, but it is a small math function. Real neurons are far more complicated, so the model is a simplified picture, not a copy.

What does ReLU actually do?

ReLU, short for rectified linear unit, is the rule max⁡(0,z)\max(0, z). Positive values pass through unchanged and negative values become 0. It is cheap to compute, which is one reason it is common in deep networks.

Why does the neuron need a bias if it already has weights?

The weights set how strongly each input pushes. The bias sets where the threshold sits, so the neuron can shift its decision point even when the inputs are all zero.

Do the weights stay the same forever?

No. Training changes them after examples are processed, based on how wrong the output was. The gradient descent rule explains how that adjustment works.

Sources

  1. Artificial neuron, Wikipedia
  2. Rectifier (neural networks), Wikipedia

All AI & ML formulas |

Published 2026-10-22. Plain-text copy for AI agents and readers: ai-ml/artificial-neuron.md.