The artificial neuron
Why this matters
Every neural network is built from one small unit, copied over and over. That's true of a spam filter. It's also true of a chatbot with hundreds of billions of parameters (adjustable numbers). The unit is called a neuron. You've already trained one without calling it that: logistic regression, from Phase 3. This lesson shows exactly what one neuron can do, and the kind of pattern it can never learn. That gap is why networks need layers, which is the story of this phase.
- Compute a neuron's output: a weighted sum plus a bias, passed through an activation
- Recognize logistic regression as a single neuron
- See a neuron's decision boundary as a straight line
- Explain why one neuron can't learn XOR, and why that matters
A neuron is a tiny scorecard
Picture deciding whether to go for a run after work. You weigh a few things. Sunshine pushes you toward yes. Rain pushes you toward no, and pushes hard. You also have a starting mood. Some days you're keen before you even look outside, and some days you're not.
A neuron makes a decision the same way. It takes in a few numbers, called inputs. It gives back one number, its output. It gets there in two steps.
Step 1: the weighted sum. Each input has a weight. A weight says how much its input matters, and in which direction. A positive weight pushes the output up. A negative weight pushes it down. The neuron multiplies each input by its weight and adds up the results. Then it adds one more number, the bias. The bias is the starting mood: where the score sits before any input has a say.
Call the result . Write the first input as . Its weight is . The second input is . Its weight is , and so on. The letter is the bias. Say there are inputs. Then the weighted sum is . The three dots mean "and so on, for every input".
In plain words: multiply each input by its weight, add them all up, then add the bias.
The short form on the right uses bold letters for whole lists. The bold is the list of weights. The bold is the list of inputs. The dot between them is the dot product from Phase 2: multiply in pairs, then add. In NumPy that's np.dot(w, x).
Try it with small numbers. Two inputs are and . Their weights are and . The bias is . Then .