Session 1 — How Neural Networks Think
Duration: 75 min · Format: live online
What you'll learn: by the end, you can explain what a single neuron does, how neurons stack into layers to make a neural network, and where a network's "knowledge" actually lives — and you'll build a working neuron in Python.
Soft skill focus — Curiosity
Today you'll also grow Curiosity. "Deep learning" sounds like magic — the best way to demystify it is to keep asking "but how does that actually work?" until the magic becomes machinery.
- Try this: before you accept any explanation today, pause and predict it yourself first — "what do I think happens when these numbers go in?" Then run the code and compare. The gap between your guess and the truth is where the real understanding lands.
- Think about: "What is one thing about AI you've always wanted to understand — and what could you build to find out?"
What you'll need
- Google Colab open in a tab, signed in, ready for a new notebook.
- The diagram below open so you can trace the flow as you read.
- Paper and a pen — you'll do one calculation by hand before the computer does it.
Hook
Your brain has about 86 billion neurons. Each one is simple — it takes signals in, and if they add up past a threshold, it "fires" a signal on. You are, right now, a network of simple parts doing something extraordinary.
A neural network borrows exactly that idea. No neuron is smart on its own. But wire up enough simple neurons, let them adjust, and the network can recognise a face, translate a language, or drive a car. Today you meet the single neuron — the Lego brick that everything in modern AI is built from.
Teach — What one neuron does
A neuron does four tiny steps, every time:
- It takes some inputs (numbers) — say the pixels of an image, or two features like
hours_studiedandhours_slept. - It multiplies each input by a weight — a number that says how much this input matters.
- It adds them all up (plus one extra number called the bias).
- It runs that total through an activation — a function that decides how strongly to fire.
That's it. The whole of deep learning is this, repeated a lot.
⚠ Watch out: the "learning" is not in the neuron — it's in the weights. A freshly-made network has random weights and knows nothing. Training is the process of nudging those weights until the outputs are right. Keep that idea front and centre all unit.
Teach — Stacking neurons into a network
One neuron can only do so much. So we stack them into layers, and connect every neuron in one layer to every neuron in the next.
- The input layer holds your data (one neuron per feature or pixel).
- The hidden layers in the middle each learn to spot bigger patterns from the layer before — this is the "deep" in deep learning: more layers, deeper patterns.
- The output layer gives the answer (e.g. "cat" or "dog", or a probability).
Every arrow is a weight. A real network can have millions of them — and all of its knowledge is just those numbers.
Activity — Build a neuron in Python
Let's build the four steps yourself. Open a new Colab notebook and type this in.
First, by hand (30 seconds): inputs [2, 3], weights [0.5, -1], bias 1. Work out the sum: 2×0.5 + 3×(-1) + 1. Write down your answer, then let the code check you.
Type and run this:
import numpy as np
def neuron(inputs, weights, bias):
total = np.dot(inputs, weights) + bias # steps 1-3: multiply and add
return 1 / (1 + np.exp(-total)) # step 4: sigmoid activation (0 to 1)
inputs = np.array([2, 3])
weights = np.array([0.5, -1])
bias = 1
print("raw total:", np.dot(inputs, weights) + bias)
print("neuron output:", neuron(inputs, weights, bias))
Now experiment:
- Was the raw total the same as your hand answer? (It should be
-1.5.) - Change a weight to a big positive number. Does the output move toward
1(fires strongly)? - Make the total very negative. Does the output move toward
0(stays quiet)?
You just ran the exact operation that happens billions of times inside a trained model.
Check yourself
- What are the four steps a neuron does? → Multiply inputs by weights, add them up (plus bias), then apply an activation.
- Where does a network's "knowledge" live? → In the weights (and biases) — the connection numbers, learned during training.
- What makes a network "deep"? → It has many hidden layers, each learning bigger patterns from the layer before.
Wrap-up
You now know the one idea the entire field is built on: a neuron is a weighted sum plus an activation, and a network is layers of them. Everything else — training, vision, language models — is this idea, scaled up and taught to adjust its own weights.
- Try this at home: change your neuron's activation from
sigmoidtomax(0, total)(called ReLU — the most common activation in modern networks). Feed it a few inputs and describe, in one sentence, how its behaviour differs from sigmoid.
Tips & extra challenges
- Watch out: it's tempting to think a bigger network is always smarter. More layers can find deeper patterns but also need far more data and can memorise instead of learn — you'll meet this trade-off (overfitting) in Session 12.
- Want more? Try this: build a tiny layer — write a function that runs three neurons on the same inputs (three sets of weights) and returns all three outputs as an array. That's a real hidden layer, in about five lines.
Vocabulary
| Term | Meaning |
|---|---|
| Neuron | A unit that does a weighted sum of inputs, then an activation |
| Weight | A number saying how much an input matters (learned in training) |
| Bias | An extra number added to the sum to shift the output |
| Activation | A function (e.g. sigmoid, ReLU) that decides how strongly to fire |
| Layer | A group of neurons; networks stack input, hidden and output layers |
Resources
- Google Colab — where you'll write and run everything this course.
- 3Blue1Brown — "But what is a neural network?" — the best visual introduction there is.
- TensorFlow Playground — watch a network learn in your browser, no code.
Practice set
Practise on your own — work these easy → hard. Answers follow each arrow.
1. Spot the parts. In a neuron with inputs [1, 0, 1] and weights [2, 5, -1], which input is being ignored by the maths, and why? → The middle input (its value is 0, so 0 × 5 = 0 — it contributes nothing this time, even though its weight is large).
2. Predict the fire. A neuron's total comes out very large and positive. With a sigmoid activation, is the output closer to 0 or 1? → Closer to 1 — sigmoid squashes big positives toward 1.
3. Compute it. Inputs [4, 2], weights [1, -2], bias 0. What is the raw total (before activation)? → 4×1 + 2×(-2) + 0 = 0.
4. Reason about weights. A trained spam detector gives the word "free" a large positive weight and "meeting" a large negative weight. What has it learned? → That "free" pushes toward spam and "meeting" pushes toward not-spam — the weights encode what each input means for the decision.
5. Build a layer (harder). Write Python that runs two neurons on inputs [1, 2] — neuron A weights [1, 1], neuron B weights [-1, 2], both bias 0 — and prints both raw totals. → A: 1+2=3; B: -1+4=3. (Any correct np.dot version earns it.)
Going deeper (optional)
Optional — for when you want to know why the activation matters at all.
Why not just add the numbers? If a neuron only did steps 1–3 (multiply and add), then stacking layers would be pointless: a stack of pure additions collapses into one big addition (it's all still linear). The activation bends the line — it lets each layer add something non-linear, and it's exactly that bending, layer after layer, that lets deep networks model curves, images and language instead of only straight-line relationships. Try it in TensorFlow Playground: set the activation to "Linear" and watch even a big network fail to separate a circle of dots; switch it to "ReLU" and watch it succeed.
Common mistakes & fixes
- Mistake: Thinking the neuron "decides" things by itself. → Fix: the neuron only does arithmetic; the weights (set by training) are what encode any decision.
- Mistake: Forgetting the bias. → Fix: always add the bias to the weighted sum — it lets the neuron fire even when inputs are zero, and shifts its threshold.
- Mistake:
np.dotshape errors. → Fix: make sureinputsandweightshave the same length; printinputs.shapeandweights.shapeif it complains. - Mistake: Expecting sigmoid output outside 0–1. → Fix: sigmoid always returns a value between 0 and 1 — that's the point; it's a "how strongly does it fire" dial.
What's next
Session 2 — How Networks Learn: right now your weights are just numbers you picked. Next you'll discover how a network finds the right weights by itself — the loss function, gradient descent, and the training loop that powers all of deep learning.