Gradient LabStart the lesson

Lessons › Chapter 8: Neural networks

Multilayer networks

Put neurons side by side to make a layer, then stack layers. Every neuron in one layer connects to every neuron in the next. This is a multilayer network.

Watch it move. This lesson is interactive on Gradient Lab: every step is an animated scene you can replay.

Start the interactive lesson

Step by step

Story

Reading cheque amounts

Brightbank wants to read handwritten amounts on scanned cheques automatically.

Concept

Stack neurons in layers

Put neurons side by side to make a layer, then stack layers. Every neuron in one layer connects to every neuron in the next. This is a multilayer network.

Build

Input, hidden, output

The first layer takes the raw input and the last gives the answer. The layers in between are hidden layers: nobody tells them what to compute; they figure out useful in-between features on their own.

Key idea

Each layer builds on the last

The first hidden layer might each draw one straight cut through the data. The next layer combines those cuts into corners and regions. Layer by layer, simple pieces become complex shapes.

Insight

Deep means many layers

Add more and wider layers and the network can learn astonishingly complex patterns: faces, speech, language. “Deep learning” simply means networks with many layers.

Real life

In real life: reading handwritten postcodes

Postal services were among the first big users of neural networks, reading handwritten postcodes on envelopes so letters could be sorted by machine. The same kind of network now reads cheques and forms.

Quick check: Why add hidden layers?

Each hidden layer combines the previous layer’s features into richer ones.

Pseudocode

hidden1 = relu(W1 × input + b1)
hidden2 = relu(W2 × hidden1 + b2)
output  = sigmoid(W3 × hidden2 + b3)

# each hidden layer builds new features out of the last one

Key terms

hidden layer
A layer between input and output. Its neurons build new features.

Build it: A neural network that reads handwriting (35 min, runs in your browser)

See the project

In the news

Recent models and papers that build on this idea: