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 stack of recordings tagged yes and no feeds a learning algorithm, which turns the knobs on a box called the model.
Knobs that learn a word

Labels set the knobs

Here is the trick the book offers. You cannot write down how you recognise the word "Alexa", but you recognise it at once. So you can do something else: collect thousands of short recordings and mark each one yourself, yes if it contains the word and no if it does not.

A vertical loss scale with an arrow pointing down labelled better, and the formula loss = − score.
The right data and a fair score

Lower is better

The third ingredient answers a question that sounds philosophical. We said that learning means getting better at a task. But who decides what "better" is? If one person proposes a change to the model, another may well argue that it made things worse.

The same price line with a third point at 3 hours, 420 dollars, above the line's 350; a dashed gap of 70 between them and the squared miss 70² = 4,900.
How much? Regression

A bill off the line

The plumber was an easy case, because two bills fixed the two knobs exactly. Real data is rarely so kind. A third bill might have been 420 dollars for 3 hours, because the pipes were older or the job was on a Sunday, things that hours alone do not capture.

The sentence Tom has dinner in Washington with Sally with a mark under each word, Ent under the names; below, a long sound wave of 48,000 samples mapped to six words.
When order matters: sequences

Aligned tags, unaligned audio

The book picks out a few special cases. The first is tagging and parsing, where every word of a text gets a mark. Here the input and output are aligned: there is one mark per word, in the same order as the words. In part-of-speech tagging, each word gets its grammatical role, such as noun or verb.

Two coffee machines: machine A showing 6, machine B showing a question mark; arrows labelled exploit to A and explore to B.
Learning by acting: reinforcement learning

Exploit or explore

A second difficulty is partial observability: what the agent sees now may not tell it where it is. Imagine your cleaning robot stuck in one of several identical cupboards in your house. From inside, they all look the same; to find which one it is in, it must remember what it saw before it went in.

A column of four games from bottom to top, backgammon, chess, Go, poker, with an upward arrow labelled harder; poker marked hidden cards.
Hidden successes, visible ones

A ladder of games

Games have long served as a yardstick of human ability, and the book traces a ladder of them. It begins with TD-Gammon, a backgammon program that learned by a form of reinforcement learning.

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