
We earn a commission if you buy through these links. Learn more
Grokking Deep Learning
by Andrew Trask
A patient, code-first walk through how neural networks really learn, built from plain Python and NumPy so the mechanics feel understandable before any framework hides them.
What It's About
Grokking Deep Learning is a hands-on introduction to neural networks that starts from Python and a numerical library rather than a deep learning framework. Trask asks you to write the mechanics yourself: a single neuron making a prediction, a loss function measuring how wrong that prediction is, and gradient descent nudging weights toward better answers. Because the ideas arrive in small, runnable pieces, the subject feels like something you can build rather than a wall of notation.
The pacing is patient. Each concept is introduced with a tiny example and then extended until it becomes the machinery for something larger, such as stacking layers and passing error backward through them. The tone is conversational and the code does most of the teaching, so reading the book often feels closer to working through a notebook than to reading a textbook.
The payoff is intuition rather than memorized formulas. You come away able to explain what a network is doing at each step, which makes later framework work less mysterious. The final stretches move toward applied topics such as language modeling and representing words as vectors, along with a brief look at privacy-preserving training. Those sections are shorter and more survey-like than the core material, so the book is strongest where it stays close to first principles.
Read this if you…
- want to understand what a neural network actually computes before relying on a library
- already write some Python and are comfortable with basic algebra
- learn best by typing code and watching the numbers change
Skip it if you…
- want rigorous mathematical proofs or a theory-heavy treatment
- need production-ready skills in a specific framework like PyTorch or TensorFlow
Key Ideas
- 1
Learning is just adjusting weights to reduce error
A network is a function with adjustable numbers inside it. Training means measuring how far its outputs miss the target and changing those numbers slightly in the direction that shrinks the miss. The book makes this concrete with very small models, so you can watch a single weight move and see why the process converges. Once this picture clicks, the rest of the material reads as variations on one idea.
- 2
Gradient descent as the engine of improvement
Gradient descent is presented as a repeated, practical habit rather than an abstract calculus result. You compute how much each weight contributed to the error, then step it in the opposite direction, over and over. The book shows how the size of those steps affects whether learning settles down or oscillates, which is a useful lesson for anyone who later tunes a real model.
- 3
Backpropagation as error assigned layer by layer
Backpropagation is the step that makes deeper networks trainable, and it is often the hardest part of the subject. The book builds it up by passing error signals backward through stacked layers, one piece at a time. Readers who have seen the formula without understanding it often find this the most valuable section, because the reasoning becomes visible in the code.
- 4
Building intuition before reaching for frameworks
The central teaching bet is that writing the arithmetic yourself makes frameworks like TensorFlow or PyTorch easier to understand later. You learn what a layer, an activation, or a loss actually does, rather than treating them as black-box calls. This makes the book a foundation for practical work rather than a replacement for it.
Limitations
The book deliberately works with small, simple networks, so it does not cover the architectures that dominate modern work, such as convolutional networks at scale or transformers. Writing everything in NumPy is excellent for learning but slow and impractical for real datasets. Some readers find the later chapters less developed than the opening material, and the privacy-related topics are introduced briefly rather than explored in depth. Anyone expecting a complete survey of current deep learning will need further reading.
Questions Readers Ask
- Do I need a strong math background to read Grokking Deep Learning?
- Not a heavy one. The book assumes comfort with basic algebra and Python, and it explains the calculus intuition it needs in plain language, supported by code. Readers who have forgotten derivatives can usually follow along, though the backpropagation section rewards a slower pace and some willingness to work through the examples by hand.
- How does it compare to Deep Learning with Python by François Chollet?
- Chollet's book is more practical and built around the Keras framework, so it suits readers who want to build models quickly. Trask's book goes the other way, building the mechanics from scratch in NumPy. Many readers use Grokking first for intuition and then move to a framework-focused book for hands-on projects.
- Is the material still relevant given how fast deep learning has changed?
- The core ideas, including weights, loss, gradient descent, and backpropagation, remain the foundation of nearly every modern network. What has aged is the coverage of newer architectures and tooling, which the book does not address in depth. It is best treated as a durable foundation rather than a guide to current best practice.
- Published
- 2019
- ISBN
- 9781617293702
- Difficulty
- beginner
- Category
- Education
Book details and cover from Google Books.
Ready to read Grokking Deep Learning?
Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.