Course Content
Deep Learning Essentials
13 sections · 61 lessons
What is an artificial neuron, and how does it relate to a biological neuron?
What you need to know
What the neuron computes
An artificial neuron does two steps:
z = w1*x1 + w2*x2 + ... + wn*xn + b (weighted sum, called the pre-activation)a = activation(z) (the output, called the activation)x1..xnare the inputs (pixel values, audio features, transaction amount).w1..wnare the weights: how much each input matters, and in which direction.bis the bias: a constant that shifts the result up or down.- The activation function decides the output shape. ReLU returns
max(0, z). Sigmoid squasheszinto 0 to 1.
Here is one neuron with real numbers:
1import torch23x = torch.tensor([0.8, 0.2, 0.6]) # three input features4w = torch.tensor([1.5, -2.0, 0.5]) # learned weights5b = torch.tensor(-0.3) # learned bias67z = w @ x + b # 1.2 - 0.4 + 0.3 - 0.3 = 0.88print(torch.relu(z), torch.sigmoid(z)) # tensor(0.8000) tensor(0.6900)The dot product w @ x multiplies each input by its weight and adds them. The second input has a negative weight, so a larger x2 pushes the output down.
The biological inspiration
| Biological neuron | Artificial neuron |
|---|---|
| Dendrites receive signals | Inputs x |
| Synapse strength | Weights w |
| Cell body adds up signals | Weighted sum z |
| Fires if above a threshold | Activation function |
| Axon sends signal onwards | Output a to the next layer |
Where the analogy breaks
- Real neurons communicate with spikes over time; artificial neurons pass one number, once.
- A real neuron has thousands of synapses with chemical and timing effects. An artificial neuron is one dot product.
- The brain does not run backpropagation as we use it. How the brain actually learns is still researched.
- The brain uses about 20 watts. Training a large model uses megawatts.
Saying this clearly shows you understand the maths, not only the metaphor.
A real-life example
A bank flags risky card transactions. Imagine one neuron with three inputs: amount in thousands of rupees, whether the merchant is new to this card (0 or 1), and hour of day scaled to 0–1.
After training, the weights might be 0.4 for amount, 2.1 for "new merchant", and 0.3 for hour, with bias −3. A ₹2,000 purchase at a familiar grocery store gives z = 0.8 + 0 + 0.2 − 3 = −2.0, sigmoid about 0.12: low risk. A ₹9,000 purchase at a new merchant at 2 a.m. gives z = 3.6 + 2.1 + 0.03 − 3 = 2.73, sigmoid about 0.94: high risk.
The large weight on "new merchant" shows what that neuron learned matters most. A real fraud model has thousands of such neurons working together, each learning a different pattern.
Follow-up questions to expect
- "What is a perceptron?" — The original 1958 artificial neuron with a step activation that outputs 0 or 1. It can only learn linearly separable problems.
- "Why do we need the activation function?" — Without it, stacked layers collapse into one linear function, so depth adds no power.
- "Is a neuron the same as a node or unit?" — Yes, these words are used interchangeably in deep learning.