gitwtfhub

wtf is neural-networks-and-deep-learning?

mnielsen/neural-networks-and-deep-learning — explained in plain English

Analysis updated 2026-06-24

17,651PythonAudience · researcherComplexity · 2/5LicenseSetup · moderate

TL;DR

Python code samples from Michael Nielsen's free book Neural Networks and Deep Learning. A from-scratch educational implementation, not a production framework.

Mindmap

mindmap
  root((nndl-code))
    Inputs
      MNIST data
      Hyperparameters
    Outputs
      Trained network
      Accuracy on test set
    Use Cases
      Follow along with the book
      Learn backprop from scratch
      Teaching reference
    Tech Stack
      Python
      NumPy
    Notes
      Python 2 only
      Not actively maintained

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Run the code examples alongside Michael Nielsen's free book

REASON 2

Study a clean from-scratch neural net training loop

REASON 3

Teach backpropagation using minimal NumPy code

What's in the stack?

PythonNumPy

How it stacks up

mnielsen/neural-networks-and-deep-learningagent0ai/agent-zeropytorch/vision
Stars17,65117,65017,675
LanguagePythonPythonPython
Setup difficultymoderatehardmoderate
Complexity2/54/54/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Code was written for Python 2.6 or 2.7. Use a community Python 3 fork or expect to patch it.

MIT license. Use freely for any purpose including commercial, keep the copyright notice.

Wtf does this do

This repository contains the Python code samples that accompany the book "Neural Networks and Deep Learning" by Michael Nielsen. The book is a free online resource that explains how neural networks, the foundational technology behind modern AI, actually work, starting from first principles. The code here is meant to be read alongside the book, giving you runnable examples that demonstrate the concepts explained in the text. The code is written in Python and is primarily intended as a companion to the written material rather than a standalone toolkit. The author has stated he does not intend to add new features or update the code for newer versions of Python, it was written for Python 2.6 or 2.7 and is kept as-is for historical consistency with the book. A community fork with Python 3 compatibility exists separately. You would use this repository if you are working through the "Neural Networks and Deep Learning" book and want to run the code examples yourself, or if you want to study a clear, educational implementation of neural network training written without heavy frameworks. The code is released under the MIT license, which means you are free to use, copy, and modify it for any purpose.

Yoink these prompts

Prompt 1
Port mnielsen's neural-networks-and-deep-learning network.py from Python 2 to modern Python 3
Prompt 2
Walk me through the backprop math in this repo's network.py line by line
Prompt 3
Run the MNIST training example from this repo on a fresh Python 3.11 setup and fix any errors
Prompt 4
Compare this from-scratch network with an equivalent PyTorch implementation for the same MNIST task

Frequently asked questions

wtf is neural-networks-and-deep-learning?

Python code samples from Michael Nielsen's free book Neural Networks and Deep Learning. A from-scratch educational implementation, not a production framework.

What language is neural-networks-and-deep-learning written in?

Mainly Python. The stack also includes Python, NumPy.

What license does neural-networks-and-deep-learning use?

MIT license. Use freely for any purpose including commercial, keep the copyright notice.

How hard is neural-networks-and-deep-learning to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is neural-networks-and-deep-learning for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.