Deep Learning: Making It Learnable

A course companion in native Python and PyTorch

Author

Heman Shakeri

Published

July 13, 2026

Preface

Warning

Draft. This book is being written in the open as the companion text for DS 6050 Deep Learning at UVA’s School of Data Science. Chapters appear as they mature; everything here runs — every figure and result is produced by the code on the page.

Deep learning did not appear out of nowhere. Nearly every idea that powers modern AI is a classical idea — a line of best fit, a hand-designed image filter, a kernel-weighted average — that someone dared to ask one question about:

What if we made this learnable?

That question is the spine of this book. We will ask it over and over:

  • Take linear regression, let its features be learned, and you get the multilayer perceptron.
  • Watch the MLP fail to generalize on images — see the failure in pictures — and the cure (respecting the structure of the data) becomes obvious: an inductive bias.
  • Take the fixed filters of classical computer vision, make them learnable, and you get the convolutional network.
  • Take kernel regression — a century-old way to average nearby evidence — make the similarity function learnable, and you get attention, then self-attention, then the Transformer.
  • Then comes the BERT moment: stop training from scratch at all, and adapt what has already been learned.

Each part of the book replays this same move at a larger scale. By the end, the modern stack should feel less like a zoo of architectures and more like one idea, compounding.

How to read this book

Every chapter follows the course’s learning loop: read → run → check. The code is native Python and PyTorch, written to run on an ordinary laptop CPU — small data, honest experiments. Watch the lecture videos, read the chapter, run the cells, and test yourself against the self-checks on the course site.

Acknowledgments

To the students of DS 6050, whose questions shaped every explanation here.


Text and figures licensed CC BY-NC-SA 4.0; all code MIT. Source on GitHub.