Loading
Module 7 of 12

Neural Networks: The Basics

About 12 minute read

Neural networks power almost everything people mean when they say "AI" today — image recognition, language models, recommendation engines. The building block behind all of that complexity is surprisingly small: a single artificial neuron.

A single neuron

A neuron takes a vector of inputs, multiplies each one by its own weight, adds them up (that's the dot product from Module 2), adds one more number called the bias, and passes the result through an activation function.

x₁w₁x₂w₂x₃w₃Σ + bactivationy
A single artificial neuron: multiply each input by a weight, add a bias, then apply an activation function.

As an equation: z=w1x1+w2x2+w3x3+bz = w_1x_1 + w_2x_2 + w_3x_3 + b, then y=activation(z)y = \text{activation}(z). This should look familiar — it's multiple linear regression from Module 5, with one extra step (the activation function) tacked on the end.

Why activation functions matter

Without an activation function, stacking neurons together would still just be linear regression no matter how many layers you added — a line combined with a line is still a line. Activation functions introduce non-linearity, which is what lets networks learn curved, complex decision boundaries instead of only straight ones. A common choice is the sigmoid function, which squashes any input into a value between 0 and 1 — convenient for representing "how confident am I this is class A?"

Tune a neuron into a classifier
Adjust the weights and bias so the line correctly separates the blue points from the orange points.
z=1.0x1+1.0x2+0.0z = 1.0x_1 + 1.0x_2 + 0.0y=sigmoid(z)y = \text{sigmoid}(z)
Accuracy: 38% (3/8 correctly classified — points circled in red are wrong)
Key idea: A single neuron with a sigmoid activation is, in effect, a classifier just like the one in Module 6 — it draws one straight decision boundary. The real power of neural networks comes from combining many neurons across many layers.

From one neuron to a network

A neural network arranges neurons into layers: an input layer (your raw features), one or more hidden layers (where the actual pattern-finding happens), and an output layer (the prediction). Every neuron in one layer typically connects to every neuron in the next layer, each connection carrying its own weight.

Input layerHidden layerHidden layerOutput layer
A deep neural network is just neurons like the one above, arranged in connected layers.

Each hidden layer learns to combine the previous layer's outputs into new, more abstract features. In an image classifier, early layers might detect simple edges, middle layers might detect shapes made of those edges, and later layers might detect entire objects made of those shapes — a progression you'll see again in Module 9.

"Deep learning" simply refers to networks with many hidden layers stacked on top of each other. More layers means the network can represent more complex functions — but it also means more parameters to learn, which is exactly where Module 8's training algorithm comes in.

Check your understanding
1. What does a single artificial neuron compute, in order?
2. Why are activation functions necessary in a multi-layer network?
3. "Deep learning" refers to networks that have:
Did you like the lesson? 😆👍
Consider a donation to support our work: