Library · CC BY-SA 4.0

Dive intoDeep Learning

Dive into Deep Learning

Cover illustration of the book

Choose your version

The same text, told at every level, in every language and look shown here. Pick, then listen or download.

Listen and watch

The same player the product gives for your own book: the voice, the drawings as they are drawn, the text.

The open textbook used in hundreds of university courses on neural networks. Its first chapter explains what it means for a program to learn from data: models, losses, optimisation, the kinds of learning problems, and how deep learning came to win.

This is a sample: 1 of 23 chapters.

From the lectures

A pile of recordings marked yes or no feeds a program box with three knobs; its answers are checked against the marks, and an arrow back turns the knobs.
Programs that learn from examples

Turning the knobs

Here is the way out, and it is the central idea of the chapter. You cannot write the rule for recognising "Hey Siri", but you can recognise it yourself. So people collect a huge set of recordings and mark each one: this one contains the wake word, this one does not.

A U-shaped curve of loss against a knob setting, with a ball that steps down the slope towards the bottom in small moves.
Scoring the model, and the exam it must pass

Walking downhill

When the model predicts a number, the usual loss punishes the size of each miss, with big misses counting far more than small ones.

A bar split into 20 per cent death cap and 80 per cent safe; below, two choices: eat, with a deadly cost, and throw away, with the small cost of a lost dinner.
How much, or which one?

Weigh chance and cost

The book makes the point with a mushroom found in a garden. A classifier trained on photographs says there is a twenty per cent chance it is a death cap, the deadliest mushroom there is. So it is eighty per cent sure the mushroom is safe, and you would still be a fool to eat it.

A row of word boxes with one box hidden as a blank; an arrow from the neighbouring words points to the guess filling the blank.
Learning without a boss, and a world that changes

The data sets the exercise

A clever middle way is self-supervised learning, where the data supplies its own exercises. Hide a word in a sentence and ask the model to guess it from the words around it; with all the text in the world to practise on, no person has to label anything.

Sixteen foot lengths drawn as bars side by side; the shortest and the longest are crossed out, and a horizontal line marks the average of the rest.
Learning by acting, and where it all began

Köbel's foot

Now the book steps back into history, because the wish to learn from data is centuries old. Gauss gave us the method of least squares, still used in insurance and medicine, and simple straight-line models describe laws such as the link between current and voltage in a wire.

Two bars of the top-five error rate on ImageNet: 28 per cent in 2010 and 2.25 per cent in 2017.
Where it already works, and what makes it deep

Error on ImageNet

Recognising objects in photos went from hard to routine: on a standard test, the best systems in 2010 missed about twenty-eight per cent of the time, even when allowed five guesses; by 2017 they missed about two per cent. The same methods now identify birdsong and help diagnose skin cancer.

How it was made

Examples for: a curious adult with school maths who uses ChatGPT and phone apps; add one modern instance per idea, such as a chatbot, a spam filter, a recommendation feed or a voice assistant

The source

The lectures retell the English text of d2l.ai (Cambridge University Press, 2023), GitHub d2l-ai/d2l-en by Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola, published under an open licence that allows retelling and translation. The retelling, the drawings and the voice are made by AI and checked against the book by a second model. How AI is used.

The lectures adapt the original and are released under the same licence, free to share and adapt with credit to the author and a link to this page: CC BY-SA 4.0

Your own hard book, the same way

Upload a textbook or any difficult book. The first five minutes are free.

Upload a book