What we will build
Picture four students. You know how many hours each one studied. You know if they passed (1) or failed (0).
| Study Hours | Passed |
|---|---|
| 1 | 0 |
| 2 | 0 |
| 3 | 1 |
| 4 | 1 |
The pattern is obvious to you: more study hours tends to mean pass. A tiny neural network will learn that pattern from the numbers—not from rules we hard-code.
We are not building ChatGPT. We are building one neuron, then two inputs, so you can see the full loop: predict → measure mistake → adjust → repeat.
Why start this small?
Real models have millions of weights. That noise hides the mechanics. With four rows and one weight, you can:
- Calculate a prediction on paper
- See why loss goes up or down
- Watch weights change epoch by epoch
When you later open PyTorch, you’ll recognize the same skeleton underneath.
What is a neural network?
Plain version: a neural network is a set of small math units. Each unit takes input, tweaks it with numbers called weights and bias, and returns an output.
The building block looks like this:
output = input × weight + bias
| Piece | Role |
|---|---|
| Input | The data (here: study hours) |
| Weight | How strongly that input pushes the output |
| Bias | A constant shift—lets the line cross the axis where it needs to |
| Output | The prediction (raw number at first; probability later) |
Nothing here is “thinking.” It is arithmetic all the way down.
How our tutorial fits together
Over the next pages we fill in each box. Page 2 is the neuron. Page 3 is sigmoid and pass/fail. Page 4 is loss and training.
From hours to pass/fail (preview)
This animated concept requires JavaScript to be enabled.
Frames:
-
Study hours go in as the input.
-
The neuron multiplies by a weight, adds bias, and produces a raw score.
-
Sigmoid squeezes that score into a probability between 0 and 1.
What you should bring
- A terminal or notebook if you want to run code (optional on this page)
- Willingness to multiply two numbers by hand once or twice—it pays off later
Honest scope note
Production systems use big datasets, regularization, GPUs, and frameworks. The idea you learn here is still the same: combine inputs with weights, compare to truth, reduce loss, update weights.
Key takeaways
- We predict pass/fail from study hours using four labeled examples.
- A neuron is
input × weight + bias—no hidden intelligence. - Training is a loop: forward pass → loss → small weight changes.
Next up: we implement the single neuron and run the formula with real numbers.