A Single Neuron
A Single Neuron — Weights, bias, and an activation function in one unit.
A single neuron takes inputs, multiplies each by a weight, adds a bias, and passes the result through an activation function. Master this one unit and you understand the atom of every deep network.
- Low output
- High output
- Boundary (drag it)
- Sample input
Neuron controls
The idea in plain words
A single neuron takes its inputs, multiplies each by a weight, adds a bias, and passes the result through an activation function. Master this one unit and you understand the atom of every deep network.
Drag the weights and the output surface tilts and shifts. Push the weights very high and the activation saturates flat — its gradient goes to zero, so the neuron stops learning. That’s a preview of the vanishing-gradient problem.
Now, the math
The neuron’s output is an activation of a weighted sum plus bias:
- the weight on input i — its importance and sign.
- the bias — shifts the threshold.
- the activation — the nonlinearity.
▸ Show the derivation
The weighted sum defines a plane; the activation bends it into an output surface. Large weights make that surface steep, pushing most inputs into the flat, saturated tails where the derivative — and thus the learning signal — is nearly zero.
Trace it by hand
One neuron with two inputs x = (2, 1), weights w = (0.4, -0.6), bias b = 0.5, and a sigmoid activation f. Activation values are rounded to 4 decimal places; they come from the repo's activation core.
Compute the weighted sum
The positive weight votes for firing, the negative weight votes against; the votes nearly cancel.
Add the bias to get the pre-activation
The bias shifts the threshold — here it pushes an almost-neutral sum firmly onto the positive side.
Pass z through the sigmoid activation
The sigmoid squashes any real number into the interval from 0 to 1.
Read the output as a probability
Leaning positive but far from certain — z would need to be much larger for the output to saturate near 1.
What just happened: Weighted sum 0.2, plus bias 0.5, through the sigmoid gives 0.6682: every deep network is just this three-beat pattern — multiply, add, squash — repeated millions of times.
Now Break It
Try this: Saturating the activation (huge weights) flattens the gradient to zero — the neuron stops learning.
Control: Weight magnitude slider (set very high)
What happens: Saturated! Huge weights push the activation flat — the gradient vanishes and learning stalls.
Where a single neuron is used
A single artificial neuron bundles three ideas into one compact unit: weights that scale each input by its importance, a bias that shifts the decision threshold, and an activation function that transforms the result. This tiny building block is remarkably capable on its own. A single sigmoid neuron is exactly logistic regression, a workhorse used for credit scoring, medical risk prediction, and click-through estimation across the web. Because the neuron is differentiable, it can be trained with gradient descent, and because it is cheap to evaluate, millions of them can be composed into the layers that power image recognition and language models. Grasping one neuron in full detail is the shortest path to understanding an entire network.
A frequent misconception is that a neuron simply passes its weighted sum forward; in reality the activation function is what gives the neuron its character, and without it the unit is purely linear. Another pitfall is confusing weights and bias: weights control the orientation and steepness of the decision boundary, while the bias shifts it away from the origin, and dropping the bias forces every boundary through zero, often crippling the fit. Beginners also assume a single neuron can model complex relationships, but on its own it can only represent a linear combination passed through one nonlinearity, which is why real problems demand many neurons arranged in layers.
Frequently asked questions
What are the parts of a single neuron?
What does the bias term do?
What is the difference between weights and bias?
Can a single neuron learn anything useful?
How is a neuron trained?
Written & reviewed by the ML Visualization team · Last updated .