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.
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
| Symbol | Meaning |
|---|---|
| One input number, for example a pixel brightness or a sensor reading. The neuron has inputs in total. | |
| The weight for input . A large positive weight pushes the neuron toward firing, and a negative weight pushes against it. Training is the process that adjusts the weights. | |
| The position of one input in the list, counting from 1 up to . | |
| How many inputs the neuron has. | |
| 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. | |
| “Add up for every from 1 to ”: multiply each input by its weight and total all the results. | |
| The weighted sum plus the bias: the raw total before the activation function is applied. | |
| The activation function, a rule that turns the total into the final output. Two common examples are ReLU and the sigmoid. | |
| 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 as inputs. Each input comes with a weight , 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 . The bias is one extra number that is not tied to any input. The result is , the raw total. Nothing has been clipped or squashed yet.
The second step is the activation function . It takes and turns it into the output . 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 with weights and bias . The activation function is ReLU, which returns : a negative total becomes 0, and a positive total passes through unchanged. All values are unitless in this example.
- Multiply each input by its weight: and .
- Add the products and the bias: .
- Apply ReLU: .
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
- Forgetting the bias . Without it, the boundary the neuron can draw is forced through the origin, which is a real limit on what it can learn.
- Mixing up the weights and the inputs. The are the numbers the network learns, and the are the data that come in. A new example changes the inputs but not the weights.
- Treating the output as if it were the sum . The activation function sits between them, so a negative can become 0 and a large can be squashed.
- Assuming someone picks the weights by hand. In real networks they start with random values, and training adjusts them.
Where you will meet it
- The units of fully connected layers in a multilayer perceptron, the basic feedforward neural network.
- The filters of convolutional neural networks, which apply the same weighted sum to every small patch of an image.
- The feed-forward blocks inside transformer language models, which follow the same weighted-sum-then-activation pattern.
- Logistic regression, the classic model for yes-or-no questions, which is one neuron with a sigmoid activation.
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 . 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.
Related formulas
- Sigmoid Function: The sigmoid takes any number, however big or small, and squeezes it into a value between 0 and 1 that can be read as a chance.
- Softmax: Softmax takes a list of scores, any numbers at all, and turns them into percentages that add up to 100%.
- Gradient Descent: Gradient descent nudges a model’s settings a small step in the direction that lowers the error, then repeats until the error stops falling.