Phase 4 · Neural NetworksModule 12~34 min read

The Artificial Neuron

The building block of every neural network: weighted inputs, a bias, and an activation function — inspired by biology, but really just a tiny bit of math.

What you'll learn

Every neural network — including the ones behind ChatGPT — is built from one humble unit: the artificial neuron. It sounds biological, but it's just a weighted sum followed by a squish. Master this one tiny piece and the rest of deep learning is repetition and scale.

By the end of this module you'll be able to:

  • Describe a neuron's weights, bias, and activation
  • Compute a neuron's output by hand
  • See why a single neuron is just a linear classifier
  • Understand the famous XOR limitation that forces us to stack neurons

From biology to math

A biological neuron collects signals from other neurons and "fires" if the combined signal is strong enough. The artificial version keeps only the essence: it takes numbers in, weights their importance, adds them up, and passes the total through a function that decides how strongly to fire. That's the whole abstraction.

Anatomy of a neuron

Watch a single neuron compute its output, step by step: weight each input, sum them with a bias, then apply an activation function.

One neuron, computed step by step
Inside a single neuron
1.0x₁0.5x₂-2.0x₃outputinputsneuron

a neuron takes inputs, weights them, sums, and activates

1/4An artificial neuron receives several inputs — here x₁, x₂, x₃.
Inputs → weighted sum (z) → activation → output. Thicker lines are larger weights.

In code, a neuron is a one-liner — a dot product, a bias, and an activation:

neuron.py
import numpy as np

def neuron(x, w, b):
    z = np.dot(w, x) + b          # weighted sum + bias
    return 1 / (1 + np.exp(-z))   # sigmoid activation

x = np.array([1.0, 0.5, -2.0])
w = np.array([0.2, 0.8,  0.1])
print(round(neuron(x, w, b=0.1), 3))   # -> 0.622

Key idea

A neuron is output = activation(w · x + b). The weights say how much each input matters, the bias shifts the threshold, and the activation adds the non-linearity that makes networks powerful.

A neuron is a linear classifier

On its own, a neuron draws a single straight boundary — exactly like the logistic regression of Module 7. The weights set the boundary's orientation and the bias sets its position. Everything on one side fires high, everything on the other fires low.

What one neuron can't do

Because a single neuron only draws a straight line, it cannot solve problems that aren't linearly separable. The classic example is XOR — output 1 when exactly one input is 1. No straight line can separate those cases, and a single neuron fails at it. This limitation nearly killed neural networks in the 1960s.

Note

The escape is simple: stack neurons into layers. A hidden layer can bend the boundary into any shape, solving XOR and far more. That is the neural network — our next module.

Recap & quick check

Key takeaways

  • An artificial neuron computes output = activation(w · x + b).
  • Weights set each input's importance; the bias shifts the firing threshold.
  • The activation function adds non-linearity — without it, a neuron is purely linear.
  • A single neuron is just a linear classifier: it can only draw a straight boundary.
  • Problems like XOR aren't linearly separable, so we stack neurons into layers.

Quick check

1. What does a single artificial neuron compute?

2. What is the role of the weights?

3. Why can't a single neuron solve XOR?

4. How do we overcome the single-neuron limitation?

One neuron is a line. Wire many together and you get a network that can learn almost anything. Next up: Module 13 — Neural Networks & Forward Propagation.