Module 1 — From a Neuron to a Network
A deep neural network sounds exotic, but it is built from one tiny, almost boring part repeated millions of times: the artificial neuron. If you understand this single unit, you understand the atom that everything else — image recognizers, chatbots, the whole field — is made of. And you already met it in Course 3: it is the regression line \( w x + b \) with one twist.
What one neuron does
A neuron takes some inputs, gives each a weight, adds them up, adds a bias, and squashes the result through an activation function. That’s the whole thing:
- Weights \( w_1, w_2 \) — how strongly each input pushes the answer up or down. A big positive weight says "this input matters, and more of it means yes."
- Bias \( b \) — a thumb on the scale that shifts the neuron’s default leaning before any input arrives.
- Activation \( \sigma \) — here the sigmoid from Course 3, which squashes any number into a 0–1 "how strongly yes" score.
One neuron is already a decision-maker
The weighted sum \( w_1 x_1 + w_2 x_2 + b \) draws a straight line through the input space. On one side the neuron says "yes" (output near 1), on the other "no" (near 0). Below, two inputs can each be off (0) or on (1) — the four corners of a square. Drag the weights and bias and steer that line until the neuron behaves like a logic gate.
This activity needs JavaScript. The lesson below still covers everything.
Why stack them? Because one line isn’t enough
A single neuron can only split its world with one straight cut. That is powerful — but the moment a problem needs two cuts (think of the four corners where "exactly one input is on" should mean yes — the famous XOR problem), one neuron can’t do it. The fix is to wire neurons together: feed several neurons the same inputs, then feed their outputs into another neuron. That stack — a network — is what the rest of this course trains. Module 3 builds your first one.
from tensorflow.keras.layers import Dense # one neuron: 2 inputs, sigmoid activation — exactly the formula above layer = Dense(1, activation='sigmoid', input_shape=(2,)) # its weights are [w1, w2] and its bias is b — the knobs you just dragged
A Dense(1) layer is one neuron. A real network is just Dense layers stacked, each holding many neurons.
Check your understanding
A few questions about the neuron. You will get a score.
This activity needs JavaScript.