Deep Neural Networks
Lesson 1From linear regression to the perceptron
The smallest unit: a weighted sum, a bias, and an activation
From linear regression to the perceptron
Deep neural networks are built from layers of simple units. Before depth or convolutions, it pays to understand the smallest piece: one weighted sum of inputs, plus bias, optionally passed through an activation. This lesson walks from linear regression → logistic regression → perceptron, then clarifies what people mean by a neuron today, and how that story fits the connectionist view researchers like Geoffrey Hinton championed: intelligence from many adjustable units learning from data, not hand-written rules alone.
One picture for the whole lesson
Features x → linear part z = wᵀx + b → activation f(z) → output
Change only f and the loss, you move from regression to classification to a modern building block.
One neuron: three weighted inputs, a bias, and the sigmoid activation give a binary prediction ŷ.
Step 0, Features and a linear score
Given input vector x (features) and weights w plus bias b, the affine (linear-with-bias) map is:
This z is a score: a single number summarizing the input in a direction learned from data. Everything below reuses this same z; only what happens after z changes.
1 · Linear regression (no activation on the prediction)
Goal: predict a real value ŷ.
Loss: squared error (and friends). Output is unbounded, fine for prices, temperatures, etc.
Neuron view: a “neuron” with identity activation f(z) = z. No squashing, pure linear model.
2 · Logistic regression (one neuron with sigmoid)
Goal: predict probability for binary class y ∈ 1.
Same z, then squash with the sigmoid:
Loss: log loss / cross-entropy. You already have one computational unit: linear + nonlinear σ, the template for a classification neuron.
| Model | After z = wᵀx + b | Typical loss |
|---|---|---|
| Linear regression | ŷ = z (identity) | Squared error |
| Logistic regression | ŷ = σ(z) | Binary cross-entropy |
3 · The perceptron (Rosenblatt, 1958)
Historically, the perceptron is a binary linear classifier with a hard decision:
Weights were updated with the perceptron learning rule (mistake-driven). The geometry is the same linear boundary as logistic regression; the activation is not smooth, it jumps at zero.
Linear
Continuous ŷ
Logistic
Smooth σ(z)
Perceptron
Hard sign(z)
The three activations on the same score z
Same linear score z, three different activations, three models.
Limitation (famous): a single perceptron only learns linearly separable patterns, no XOR without multiple units / hidden layers (the start of the story for deep networks).
Perceptron vs “neuron” in modern deep learning
People use “neuron” loosely. In current frameworks, a neuron almost always means:
affine map + differentiable activation (ReLU, GELU, sigmoid, tanh, …) so gradients can flow in backpropagation.
| Aspect | Classic perceptron | Typical “neuron” today |
|---|---|---|
| Nonlinearity | Step / sign (not differentiable at 0) | ReLU, GELU, σ, … (piecewise smooth) |
| Training | Perceptron rule, mistake updates | Gradient descent on a loss (backprop) |
| Output role | Often hard class label | Real-valued activation feeding next layer |
| Summary | Logistic regression is closer to a modern classification neuron (smooth σ) than the original perceptron sign, but all three share the same linear core z = wᵀx + b. | |
Hinton and the idea of neural computation
Geoffrey Hinton did not invent the perceptron; his influence is in treating networks of simple units as the right substrate for learning representations: adjust many w’s and b’s from examples so hierarchical features emerge. Backpropagation through smooth activations made deep stacks practical, so the “neuron” in today’s deep nets is the differentiable building block you will stack in the rest of this course.
Takeaway: linear regression = linear neuron; logistic = sigmoid neuron; perceptron = historical threshold unit on the same z. Deep networks = many such units + depth and composition, next lessons.
Your whiteboard
Sketch your own version of the neuron, annotate the parts you want to remember, or draw a comparison with the perceptron's step function. Changes live in your browser only.
✏️ Scratchpad — draw, annotate, or erase freely. Changes stay in your browser only.
Build the unit yourself
One neuron is a weighted sum, a bias, and an activation. Press Run to push the same score z through all three activations, then watch a single linear unit fail on XOR:
Check your understanding
1 / 9Rosenblatt's perceptron uses a threshold (step) activation. Why does the modern artificial neuron replace it with sigmoid (or ReLU)?
Practice it yourself
One linear core, three behaviours. Build the neuron and the perceptron from scratch in the browser, with real Python and hidden tests, no setup.
The neuron's pre-activation score, shared by all three models.
Fire when z ≥ 0 — the hard step that has no usable gradient.
Switch identity / sigmoid / step and watch the model change.
Train it on AND with mistake-driven updates — and see why XOR can't work.