Deep Learning Essentials

Course Content

Deep Learning Essentials

13 sections · 61 lessons

What is an artificial neuron, and how does it relate to a biological neuron?


One neuron, with real numbersInputs0.8, 0.2, 0.6Weights1.5, −2.0, 0.5Weightedsum 1.1,plus bias −0.3z = 0.8ReLU gives0.8,sigmoid 0.69The negative weight means a larger second input lowers the output.
A neuron is one dot product, one addition and one squashing function; the biology is where the idea came from, not how it works.

What you need to know

What the neuron computes

An artificial neuron does two steps:

Text
z = w1*x1 + w2*x2 + ... + wn*xn + b     (weighted sum, called the pre-activation)a = activation(z)                        (the output, called the activation)
  • x1..xn are the inputs (pixel values, audio features, transaction amount).
  • w1..wn are the weights: how much each input matters, and in which direction.
  • b is the bias: a constant that shifts the result up or down.
  • The activation function decides the output shape. ReLU returns max(0, z). Sigmoid squashes z into 0 to 1.

Here is one neuron with real numbers:

Python
import torchx = torch.tensor([0.8, 0.2, 0.6])     # three input featuresw = torch.tensor([1.5, -2.0, 0.5])    # learned weightsb = torch.tensor(-0.3)                # learned biasz = w @ x + b                         # 1.2 - 0.4 + 0.3 - 0.3 = 0.8print(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 neuronArtificial neuron
Dendrites receive signalsInputs x
Synapse strengthWeights w
Cell body adds up signalsWeighted sum z
Fires if above a thresholdActivation function
Axon sends signal onwardsOutput 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.