0:00Intro: MOFUSA Tech Academy and Season 2
Welcome to MOFUSA Tech Academy. Beyond learning, towards mastery. And welcome to Season Two: deep learning.
0:09Build a brain cell: the hook
Your brain contains around eighty-six billion nerve cells, called neurons. Each one receives signals from others, and if those signals are strong enough, it fires, passing a signal on. In the nineteen-fifties, researchers asked a bold question: could we build a simplified, mathematical version of a neuron, and connect many of them so they learn? That question led, decades later, to the neural networks behind image recognition, speech recognition and today's language models. And here's the surprising part: you already know almost everything inside an artificial neuron.
You met it in Season One. Today, we build one, train it, and discover the problem that once stalled the entire field. Season Two, Module Seven: neural networks. First stop, at the foot of the mountains: the neuron.
1:05From biology to maths, carefully
A biological neuron gathers signals through branches called dendrites, combines them in the cell body, and if the combined signal passes a threshold, it fires a signal down its axon to other neurons. The artificial neuron borrows that outline. It takes several inputs, multiplies each by a weight that says how much that input matters, adds them up with a bias, and passes the result through an activation function that decides the output. One honest caveat: this is inspiration, not imitation. Real neurons are vastly more complicated, with timing, chemistry, and thousands of connections each.
Artificial neural networks work because of mathematics, not because they faithfully copy the brain.
1:53The glass-box neuron
Here's our neuron, with live numbers. Two inputs, for a Brightcart rule: is the basket fifty dollars or more, and is the customer a member? Each is one for yes, zero for no. Inside, the neuron computes a weighted sum plus a bias: the dot product from episode two. Then the activation function turns that sum into an output. Now look closely. With a sigmoid activation, this neuron is logistic regression, exactly the model from episode eleven. A single artificial neuron is something you've already built. Rosenblatt's early neural model used a simpler activation, a hard step: output one if the sum is above zero, otherwise zero.
It's called the perceptron. With weights two and one and a bias of minus two, a member with a big basket gives a sum of one: the neuron fires, free delivery. A big basket without membership gives zero: it doesn't fire.
2:53The perceptron learning rule
Frank Rosenblatt introduced the perceptron in nineteen fifty-eight, along with a way for it to learn from examples. The rule is wonderfully simple. Show the perceptron an example. If its answer is right, change nothing. If it's wrong, nudge each weight by the input times the error, so the next time it's more likely to get that example right. Let's watch it learn Brightcart's free-delivery rule, starting from all-zero weights. Here are the four possible customers. Only the top-right one, a member with a big basket, should get free delivery.
Each mistake tilts or shifts the boundary line. Epoch by epoch, the number of mistakes goes one, three, three, two, one… and then zero. It's learned the rule, with weights two and one and a bias of minus two. There's even a theorem behind it: if any straight line can separate the two classes, the perceptron rule is guaranteed to find one eventually.
3:58A neuron draws a line
Geometrically, a single neuron does exactly what logistic regression and the SVM did in Season One: it draws a straight line, a hyperplane in more dimensions, and says yes on one side and no on the other. The AND rule is separable by a line: one green corner versus three red. So is OR, free delivery for big baskets or members, which has three green corners and one red. Problems that a single straight line can solve are called linearly separable.
4:33XOR: the problem that stalled AI
Now a trickier rule. Suppose Brightcart runs a promotion for customers who are exactly one of the two: a big basket or a member, but not both. That's called exclusive-or, or XOR. The green dots sit on one diagonal, the red ones on the other. Pause and predict: can a single straight line separate them?
No. Try any angle you like: there's always a dot on the wrong side. XOR is not linearly separable, so no single perceptron can ever learn it, however long it trains. In nineteen sixty-nine, Marvin Minsky and Seymour Papert published a famous book analysing exactly these limits of single-layer perceptrons. It helped push neural network research out of fashion for years. The way out was known in principle, more layers, but nobody yet had a good way to train them.
5:33Two layers solve XOR
Here's the solution. Add a hidden layer of two neurons between the inputs and the output. The first hidden neuron learns "OR": at least one is true. The second learns "not both". The output neuron then combines them with "AND": at least one, but not both. That's exactly XOR. Watch the truth table fill in. Neither true: zero. Exactly one: one, one. Both: zero. Solved. And here's the geometric magic. The hidden layer moves the four points into a new space. In that space, the two green points land on the same spot, and the red ones move to opposite corners, so now a single straight line separates them.
The hidden layer bent the space until the problem became easy. Remember that picture from episode two? This is it, in action. We set these weights by hand. The breakthrough that made deep learning possible was finding a way for networks to learn weights like these by themselves, in every layer. That's backpropagation, and it's two episodes away.
6:44Try it yourself: run the neuron
Let's run our trained neuron by hand: weights two and one, bias minus two. Pause and compute the output for all four customers. No big basket, not a member: two times zero, plus zero, minus two, is minus two, so it doesn't fire. A member with a small basket: minus one, no. A big basket without membership: exactly zero, and since the rule is "fire only if the sum is above zero", no. A member with a big basket: plus one, it fires. Free delivery for exactly the right customer. Now swap the hard step for a sigmoid. The outputs become zero point one two, zero point two seven, a half, and zero point seven three: smooth degrees of confidence instead of a hard yes or no.
That smoothness is exactly what lets us train neurons with gradients, as we'll see.
7:47Why the step function can't be trained
Why did the perceptron need its own special learning rule? Because its step function is useless for gradient descent. Its slope is zero everywhere, except at the jump, where it isn't defined at all. Nudge a weight slightly, and the output usually doesn't change at all, so the gradient gives no direction to follow. A sigmoid is smooth: a small change in a weight always produces a small change in the output, so there's always a slope to follow downhill. Smooth activations, combined with the chain rule from episode three, are what make it possible to train networks with many layers.
That's backpropagation, two episodes from now.
8:29What can one neuron represent?
So what can a single neuron do? Anything that one flat cut can separate. AND, OR and "not both" all work. A straight-line split of churners from stayers works. But XOR doesn't. Neither does a class shaped like a ring, or a class split into two separate islands. In three dimensions, the neuron's boundary is a flat plane; in more dimensions, a flat hyperplane. However many inputs it has, one neuron makes one flat cut.
9:03Building logic from neurons
Notice how we built XOR: from simpler pieces. An OR neuron, a "not both" neuron, and an AND neuron to combine them. With large weights, like twenty, a sigmoid behaves almost like a step, giving outputs very close to zero or one, so these neurons act like logic gates. Here's a deep fact: by combining enough such neurons, you can build any logical rule at all. That's one way to see why layered networks are so expressive. Each layer can combine the simple decisions of the layer before into more complex ones.
9:40Neurons as feature detectors
Here's another way to think about a neuron: as a detector. Its weighted sum is a dot product, and from episode two, a dot product measures how much two vectors point the same way. So a neuron fires most strongly when its input looks like its weight pattern. A neuron whose weights form a vertical bar over a small patch of pixels fires when it sees a vertical stroke. A churn neuron with positive weight on "days since last order" and negative weight on "recent orders" becomes a "drifting away" detector. In deep networks, each neuron learns to detect some useful pattern.
10:19Brains, chips and a short history
A little history. The idea of an artificial neuron goes back to nineteen forty-three, when Warren McCulloch and Walter Pitts described a simple mathematical model of a neuron. Rosenblatt's perceptron followed in nineteen fifty-eight, first as a computer simulation and later in purpose-built hardware. Then came the setback of nineteen sixty-nine, the revival when backpropagation was popularised in nineteen eighty-six, and the deep learning boom of the twenty-tens. You'll meet each of those turning points as we climb this mountain.
10:56The perceptron rule, one mistake at a time
Let's slow the perceptron rule right down and watch its first few corrections. Everything starts at zero. The member with a big basket should get free delivery, but the sum is zero, so the neuron stays silent: a mistake. The rule adds the input to the weights, and adds one to the bias. Now the weights are one and one, and the bias is one. Next round, the customer with neither gets a sum of one, and the neuron wrongly fires. Their inputs are both zero, so only the bias moves, down to zero. Then the member with a small basket also wrongly fires, so the weights move away from their input, and the bias drops again.
Notice the logic. When the neuron should have fired, its weights move towards that input pattern. When it fired by mistake, they move away. Mistake by mistake, the boundary line shuffles into the right place, until there are no mistakes left.
11:54Pause and predict: the NAND gate
One more puzzle. A neuron has weights minus two and minus two, and a bias of plus three. What does it compute? Try all four inputs. Zero and zero gives three: fire. One input on gives one: still fire. Both on gives minus one: silent. It fires unless both inputs are on. That's called NAND, "not and". And NAND is special: engineers can build every logic circuit, even a calculator, from NAND gates alone. So although a single neuron can't solve XOR, a network of neurons can compute any logical function at all. That's our first hint of why stacking neurons into layers is so powerful.
12:46Myth vs Fact
Myth: neural networks work like the human brain. Fact: they're loosely inspired by it. An artificial network is layers of weighted sums and activation functions, trained with calculus and gradient descent. The brain works very differently, and we still don't fully understand how it learns. Be wary of anyone who says an AI "thinks like a brain".
13:09Recap
Let's recap. An artificial neuron computes a weighted sum plus a bias and passes it through an activation function. With a sigmoid, it's logistic regression. The perceptron uses a step activation and learns by correcting its weights whenever it's wrong. But a single neuron can only draw a straight line, so it can't learn XOR. Add a hidden layer, and the network can bend the space until the problem becomes separable. One sentence to remember: one neuron draws a line, and layers bend the space.
13:46Next: multi-layer networks
Mission complete. We built a brain cell, an artificial one, trained it on Brightcart's free-delivery rule, and solved XOR by stacking just two layers. Next, we go deeper. We'll build full multi-layer networks, see why the activation functions between layers are essential, and discover a remarkable result: with enough neurons, a network can approximate almost any function. See you on the map.