What is a Neuron?
A gentle intro to neurons, weights, biases, and ReLU while I learn the basics of neural networks.
Mar 12, 2026
When people talk about neurons in machine learning, they usually mean a tiny mathematical unit that takes some numbers in and produces a single number out.
At its core, a neuron does three things:
- Takes inputs β a vector of numbers, e.g. features from your data.
- Applies weights and a bias β it computes a weighted sum of those inputs.
- Passes the result through an activation function β often something like ReLU.
Weights and bias
Suppose your inputs are .
Your neuron has the same number of weights and one bias .
It first computes:
What does this mean?
- are your inputs (the data you feed in, like pixel values or features).
- are the weights (how much each input matters).
- is the bias (a constant that shifts everything).
- is the result (a single number).
A simple example: If you have 3 inputs with values , , , and weights , , , and bias , then:
- Weights tell the neuron how important each input is. A larger weight means that input has more influence.
- The bias shifts the whole function left or right, letting the neuron fire even when all inputs are small or zero.
You can think of as the raw score before the neuron decides how strongly to respond.
ReLU and other activations
If we only used the weighted sum , a whole network of neurons would just behave like one big linear function. Thatβs why we add a non-linear activation function.
One of the most popular is ReLU (Rectified Linear Unit):
What does this mean?
means βtake the larger of 0 and β. In other words:
- If is positive (like ), ReLU outputs that same number: .
- If is negative (like ), ReLU outputs 0: .
Examples:
- (positive stays positive)
- (negative becomes zero)
- (zero stays zero)
This simple shape makes networks easier to train and gives them the ability to model complex, non-linear relationships in data. Itβs like a βrectifierβ that cuts off anything below zero.
Other activation functions
ReLU is just one choice. A few other common activations:
-
Sigmoid β squashes values into , historically used in early neural nets and for probabilities:
What does this mean?
- is Eulerβs number (approximately 2.718), a mathematical constant.
- means βe raised to the power of negative zβ.
- The formula takes any number (positive or negative) and squashes it into a value between 0 and 1.
Examples:
- If , then (middle value).
- If is very large (like ), (approaches 1).
- If is very negative (like ), (approaches 0).
Think of it as a smooth S-curve that converts any number into a probability-like value between 0 and 1.
-
Tanh β similar to sigmoid but outputs in and is zero-centered:
What does this mean?
- Like sigmoid, this uses (Eulerβs number).
- is βe raised to the power of zβ, and is βe raised to the power of negative zβ.
- The formula divides the difference by the sum, which creates an S-curve like sigmoid, but centered at zero.
Examples:
- If , then (exactly zero, unlike sigmoid which gives 0.5).
- If is large positive (like ), (approaches 1).
- If is large negative (like ), (approaches -1).
The key difference from sigmoid: tanh outputs can be negative, and itβs centered at zero, which can help with training.
-
Leaky ReLU β like ReLU but allows a small negative slope so neurons donβt die completely:
What does this mean?
This is a piecewise function (it behaves differently depending on the value of ):
- If (zero or positive): output is just , same as regular ReLU.
- If (negative): output is , where is a small number like .
Examples:
- If , then (positive stays positive).
- If , then (small negative value, not zero).
The parameter (often ) is the βleakβ β it lets a tiny bit of negative signal through instead of completely cutting it off. This prevents neurons from βdyingβ (always outputting zero) during training.
Interactive Activation Functions
ReLU
Rectified Linear Unit
Sigmoid
S-shaped curve, outputs (0, 1)
Tanh
Hyperbolic tangent, outputs (-1, 1)
Leaky ReLU
ReLU with small negative slope
Putting it together
A single neuron computes:
What does this mean?
This is the complete formula for a neuron:
- First part (): Compute the weighted sum of inputs plus bias. This gives you (the raw score).
- Second part (): Apply the activation function to . The Greek letter (phi) is just a placeholder for whatever activation function you choose.
In plain English: Multiply each input by its weight, add them all up, add the bias, then pass that result through an activation function.
Example with ReLU:
- Inputs: ,
- Weights: ,
- Bias:
- First compute:
- Then apply ReLU:
where can be ReLU, sigmoid, tanh, or something more modern like GELU or SiLU.
Comparing activation functions
When you stack many neurons into layers, and many layers into a network, you get the neural networks used in modern deep learning. But underneath, itβs all built from this same pattern: inputs β weighted sum + bias β activation.
This post is my starting point while Iβm learning more about how these pieces connect to training, loss functions, and backpropagation.