Does *Neural Networks and Deep Learning* Include Code and Exercises?
Updated
Yes. Michael Nielsen's online book Neural Networks and Deep Learning includes both code and exercises, and it links to a code repository. The code is woven into the chapters rather than kept in a separate section: you get implementations for classifying handwritten digits, for backpropagation, and for convolutional networks. Exercises and problems appear throughout the chapters, and the book's resource list points to a code repository.
What code is included
The table of contents shows code tied to specific chapters:
| Chapter | Code included |
|---|---|
| Using neural nets to recognize handwritten digits | Implementing a network to classify digits |
| How the backpropagation algorithm works | The code for backpropagation |
| Improving the way neural networks learn | Handwriting recognition revisited: the code |
| Introducing convolutional networks | The code for convolutional networks |
So the code follows the book's progression: a simple digit classifier first, then backpropagation, then improved training, then convolutional networks.
Exercises and problems
Exercises and problems are embedded in the chapters, not collected at the end. The book has a dedicated section, "On the exercises and problems," which explains how they are meant to be used. Expect them to sit alongside the explanations they test, so working through a chapter means engaging with its exercises as you go.
How to get the code
- Read online: the code appears in the relevant chapters at neuralnetworksanddeeplearning.com.
- Code repository: the book's Resources section links to a code repository, which is the practical place to start if you want to run or adapt the code rather than read it in the text.
Practical notes
- The book is free to read online. It asks for a small donation (a suggested $5, with a Bitcoin option) if you find it useful; this is a request, not a paywall.
- The book also links to Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville, and to Michael Nielsen's project announcement mailing list, if you want to follow related material.
If your goal is to implement a digit classifier or backpropagation from scratch while following a guided explanation, this book gives you both the code and the exercises to practice with. Start with the handwritten-digit chapter, then move to the backpropagation chapter and its code.