Библиотека · CC BY-SA 4.0

Приключения Алисы в Странедифференцируемых чудес

Alice's Adventures in a Differentiable Wonderland, Volume I: A Tour of the Land

Иллюстрация к книге

Выберите версию

Один и тот же текст на каждом уровне, на всех языках и во всех оформлениях, что здесь есть. Выберите, потом слушайте или скачивайте.

Слушать и смотреть

Тот же плеер, который продукт даёт для вашей книги: голос, рисунки по мере того, как они рисуются, текст.

Современный учебник о том, как на самом деле устроены нейросети: от тензоров и градиентов до трансформеров. Глава 6 показывает, как программа сама находит свои градиенты: автоматическое дифференцирование, обратный проход, на котором обучается любая модель.

Это пробная часть: 1 из 13 (главы).

Из лекций

Four boxes in a row joined by arrows, each with a small knob on top for its weights and a slope tag under it, and at the end a multiplication of the four tags gives the slope of the whole.
A Program That Knows Its Own Slopes

A Chain of Primitives

The book's answer starts by looking at the model as a program. When the program runs, it performs a chain of small, simple operations, one feeding the next; the book calls each one a primitive, and the whole chain, as it actually ran, a computational graph.

A chain of three boxes run left to right; under each box a page appears, and each new box sends update arrows back to every earlier page; a small grid times a grid shows the costly product.
One Number at the End, and the Slow Way Forward

Forward Mode: A Notebook

Now the first road, forward mode. Think of it as walking along the chain in the direction the program runs, carrying a notebook.

A chain of four steps ends in one error dot; a short strip of four cells starts at the error and moves left from step to step, dropping a slope tag under each step.
Walking the Chain Backwards

Carrying One Row Back

The book's key observation is that the chain ends in one number, the total error. So if you start the multiplication from that end, what you carry is never a whole table, only a single row of numbers, and a row times a table is cheap and gives another row.

Left: a big three-dimensional block crossed out next to a flat grid built from a short column and a short row of numbers; right: a row of numbers passing through a ramp-shaped switch, with negative positions set to zero and the others unchanged.
Every Piece Learns to Answer Backwards

Cheap Answers, Two Examples

Two examples show why the answers are so much cheaper than the tables. For the most common piece of a network, multiplying the input by a table of weights, the full table of slopes with respect to the weights would be a huge three-dimensional block of numbers.

Three result boxes in a chain, each with a small tag pointing back to the operation that made it and an empty slope slot; an arrow walks back from the error and fills the slots of two of them, leaving one empty.
How Libraries Do It, and Why the ReLU Won

Results That Remember

Object-style models, the usual way of writing PyTorch, need one more step. One option is to pull the weights out of the model object and call it as a plain function with those weights handed in.

Three boxes, each a different way of writing the ReLU, all fed the input zero, reporting slopes 0, 1 and 0.5; then a small branching graph whose steps are numbered in order before the walk back.
The Corner of the Ramp

Same Function, Different Slopes

The book adds a warning. For curves that bend both ways, subgradients need not exist, and mathematicians use a looser, local version instead.

Как это сделано

Примеры для: a curious adult with school maths who uses AI apps every day; add one modern instance per idea, such as how a chat assistant or a phone's photo app is trained

Источник

Лекции пересказывают с английского оригинала книгу arXiv 2404.17625 (version 3, 2025), автор — Симоне Скардапане; книга вышла под открытой лицензией, которая разрешает пересказ и перевод. Пересказ, рисунки и голос сделаны ИИ и сверены с книгой второй моделью. Как используется ИИ.

Лекции — переработка оригинала и распространяются под той же лицензией: их можно свободно распространять и перерабатывать с указанием автора и ссылкой на эту страницу: CC BY-SA 4.0

Ваша трудная книга — так же

Загрузите учебник или любую сложную книгу. Первые пять минут бесплатно.

Загрузить книгу