3.1.1 · D1Neural Network Fundamentals

Foundations — The perceptron model and history

2,714 words12 min readBack to topic

Before you touch the parent note, you must be fluent in a handful of picture-ideas. Below, every symbol you will meet is built from nothing. Read top to bottom: each item uses only things defined above it.


1. A feature — one measured number

Picture one email. We measure two things about it: how many $ signs it has, and how many ! marks it has. Each is one number. That number is a feature.

  • Plain words: one fact about one example, written as a number.
  • The picture: a slider with a value on it — say the $-count slider sitting at 2.
  • Why the topic needs it: the perceptron can only do arithmetic. So the world must first be turned into numbers. Features are that translation.

We write a feature with a lowercase letter and a small number below (a subscript): is "feature number 1", is "feature number 2". The subscript is just a name tag, not a multiplication.


2. A vector — several features held together

If one email has two features, we do not want two loose numbers floating around — we bundle them.

  • Plain words: a list where position matters ( is not ).
  • The picture: an arrow starting at the corner and ending at the point . See the figure below.
  • Why the topic needs it: it lets us talk about one whole example as a single object , and lets us picture that example as a point (the arrow's tip) on a flat map.
Figure — The perceptron model and history

What this figure shows: the single example drawn two ways at once — a lavender arrow from the origin (carrying a direction and a length) and a coral dot at its tip (a location on the map). The dotted grey lines drop from the tip to the axes to show the feature values and . The perceptron mostly cares about the dot — where does this example sit?


3. The weights — how much each feature counts

  • Plain words: an importance dial for each feature. Big positive = "this feature strongly votes YES". Negative = "votes NO".
  • The picture: the same arrow map, but now a second arrow pointing in the "YES direction".
  • Why the topic needs it: raw features don't know which of them matters. The weights are exactly the knobs the perceptron learns by turning.

4. Multiplication and the weighted sum

  • Plain words: "count each feature's vote, scaled by how much that feature matters, then total the votes."
  • The picture: two bars — one of height , one of height — stacked into one taller bar.
  • Why the topic needs it: this single total number is the perceptron's "level of enthusiasm" for saying class 1. One number is easy to compare against a threshold.

5. How many features? The number and the space

  • Plain words: means two features (a flat map you can draw). means three features (a room). means a list of 784 numbers — you cannot draw it, but the rules are identical.
  • The picture: for , is the whole flat sheet of paper; every point on it is one possible example. Larger just stacks more axes you cannot see.
  • Why we name it now: both and are lists of the same length , so both live in . Every geometric idea below — arrow, angle, side of a line — is proven in 2D but works unchanged for any . We picture ; the algebra carries the rest.

6. The dot product — the weighted sum, renamed

The parent note writes . That dot is not ordinary multiplication of two lists — it is a specific recipe: multiply matching positions, then add. It is literally the weighted sum from Section 4, extended to all features and given a shorter name.

Figure — The perceptron model and history

What this figure shows: the lavender arrow is the "YES direction". Three example arrows test it. The mint arrow leans the same way as → its dot product is a large positive number. The butter arrow sits at a right angle to → its dot product is exactly zero. The coral arrow leans the opposite way → its dot product is negative. That sign — positive / zero / negative — is the whole decision, and it works identically in even though we can only draw .


7. The bias — sliding the fence

  • Plain words: a built-in head start (or handicap). Even with all features zero, .
  • The picture: the fence line does not have to pass through the origin — the bias slides it sideways. Without , the boundary is stuck at the corner; with , it can sit anywhere.
  • Why the topic needs it: in the AND-gate example the boundary is , a line that does not pass through . Only the bias can shift it there.

We name the whole total . So is just shorthand for "weighted sum plus bias".


8. The step function — turning into a yes/no

  • Plain words: if enthusiasm reaches the line, fire (output 1); otherwise stay quiet (output 0).
  • The picture: a flat floor at height 0 that jumps straight up to height 1 the instant hits zero — a single stair step. See the figure.
  • Why the topic needs it: a perceptron must give a decision, not a mood. The step crushes the continuous into exactly two answers.
Figure — The perceptron model and history

What this figure shows: the horizontal axis is ; the vertical axis is the prediction . For all the coral floor sits at height ; the instant reaches the value leaps to the mint level at height and stays there. The closed mint dot at and the open coral dot mark the parent's fixed convention: a tie () resolves to class 1, not class 0. The jump is instant — no in-between.

The symbol (read "y-hat") is the perceptron's guess. The plain (no hat) is the true answer from the data. Keeping them apart is essential: learning happens only when .


9. The decision boundary — where

  • Plain words: the exact fence between the "predict 1" side and the "predict 0" side.
  • The picture: in 2D it is a straight line; the arrow pokes out of it at a right angle, pointing toward the class-1 side. In the same equation defines a flat hyperplane, but the picture — a fence with poking out perpendicular — is unchanged.
  • Why the topic needs it: the whole perceptron is this line. Learning = moving this line until the two colours of dots fall on the correct sides. This is exactly the idea of Linear Separability.
Figure — The perceptron model and history

What this figure shows: the lavender line is the boundary . The mint dots (class 1) sit on the side the grey arrow points to; the coral dots (class 0) sit on the other side. The arrow leaves the line at a right angle — it is perpendicular to the fence. If some straight line can split the colours cleanly, the data is linearly separable and the McCulloch-Pitts Neuron-style rule can succeed. If no line works (the XOR case), you need a Multi-Layer Perceptron.


10. The learning rate — how big a nudge

  • Plain words: step size. Small = tiny careful nudges; large = big jumps that may overshoot.
  • The picture: the fence line jumping a little (small ) versus leaping (large ) after a wrong guess.
  • Why the topic needs it: it scales the size of every correction. This same "small step in the right direction" idea grows up into Gradient Descent used everywhere in deep learning.

The arrow "" means "becomes" — replace the old value with the new one. It is assignment, not equality.


11. The update rule — how the boundary moves

Now we assemble the previous ten ideas into the one moving part of the perceptron: the rule that fixes a mistake.

The piece is the error signal. Because both and are or , this error can only be , , or .

Algebraic proof that the nudge points the right way. Suppose we make the false-negative mistake: true but , so the error is . The update sets Recompute for the same example with the new weights: Multiply out using the dot-product recipe:

  • WHAT we just did: wrote the new score as the old score plus two extra pieces.
  • WHY it matters: is a sum of squares, so it is always ; and . Therefore — the score went up, exactly the direction that pushes the guess toward .

For the mirror case (false positive: , , error ) every sign flips: we subtract , and the same algebra gives — the score goes down, pushing the guess toward . In both cases the correction moves the fence toward classifying this point correctly.

What this figure shows: a coral point that was on the wrong (class-0) side of the lavender old boundary. The error is , so we add to ; the mint new boundary has rotated/shifted so the same point now sits on the correct class-1 side. The little grey arrow shows the change added to the weight vector — the mechanism behind the move.


Prerequisite map

Feature x sub i

Vector x

Dot product w dot x

Weight w sub i

Dimension n and space R to the n

Weighted sum plus bias z

Bias b

Step function

Prediction y-hat

Decision boundary z equals 0

Linear separability

Update rule

Learning rate eta

The Perceptron

Everything on the left is a foundation; all roads feed into The Perceptron. If any left-hand box is fuzzy, re-read its section above before opening the parent note.


Equipment checklist

Cover the right side and answer aloud. Reveal to check.

What is a feature, in one sentence?
One measured number describing one example.
What does bold mean and what picture goes with it?
An ordered list of features, drawn as an arrow whose tip is a point on the map.
What does it mean that and live in ?
Both are lists of the same length (the number of features); the 2D pictures generalise unchanged to dimensions.
Spell out what computes.
Multiply matching positions (, , …, ) and add them all.
Why do we use a dot product rather than distance?
It measures how much points along the "YES" direction , giving a signed number.
What does the bias let the boundary do?
Slide off the origin so the fence can sit anywhere, e.g. .
At , does the perceptron output 0 or 1?
1 — a tie resolves to class 1 by the fixed convention.
Difference between and ?
is the true label from data; is the perceptron's guess.
What does control?
The size of the nudge applied to the weights on each mistake.
Write the weight and bias update rules.
and .
Why does adding (when ) fix the mistake?
It raises by , pushing the guess toward class 1.
What does the arrow in mean?
"Becomes" — assign the new value to .