SYNTH · a plain-language walkthrough
That question is a neural network. Not a metaphor for one — the arithmetic is identical to the code in SYNTH, my from-scratch neural network. Four lessons, no jargon until the end of each one.
Lesson 1 — one decision
Three facts about tonight. Each one pulls you toward going out or away from it, and not by the same amount. Drag them.
Pulls you out. This one matters most to you: ×0.9
Pulls you home: ×−0.7
Also pulls you home, but you mind it less: ×−0.4
The +1.0 at the end is you on a normal day, before anything happens. A cheerful person carries a bigger one and needs less convincing.
1_first_neuron.py, line for line. The inputs [1, 2, 3] are the three facts, [0.2, 0.8, -0.5] is how much each matters, and bias = 2 is the mood you start the day in.np.dot does.Lesson 2 — a row of them
Same facts, but each friend cares about different things. Nobody added new information — they just weigh it differently, so they disagree. Keep dragging the sliders above and watch all three react.
She only hears what the first three said, and weighs them. She trusts Priya, half-ignores Rahul, and actively disagrees with Sam.
2_neuronLayers.py. Its weights1 has three rows because there are three friends; each row is four numbers long because there are four facts. weights2 is the fourth friend listening to opinions instead of facts..T in the code is just turning the table sideways so the rows and columns line up.Lesson 3 — the missing piece
Here's the real test. Grey dots are what actually happened. The network has to draw a line through them. Add more friends, and flip the one rule that changes everything.
Each friend has a point where they start caring. Below it they say nothing at all — not "no", not a negative number, just zero. Above it, the more you feed them, the louder they get.
That silence is the whole trick. It lets one friend handle only rainy days and another handle only weekends, each keeping quiet outside their own case. Take the silence away and every friend has an opinion about everything, always, in a straight line — and a straight line plus a straight line is still a straight line. That's why fourteen of them just drew you one boring stroke.
self.output = np.maximum(0, inputs) # negatives become 0, positives pass through
3_layers.py — Activation_ReLU.forward is still empty there. It's one line.Lesson 4 — the half SYNTH doesn't have
Every "how much it matters" number so far was typed in by hand, or picked by np.random.randn. Real networks start with garbage and fix themselves. Press the button and watch garbage become a curve.
The loop is three steps, forever:
What to write next
-0.084. Meaningless. Squash them so they read as "70% sure it's a cat".