Guide · Open source
How to use nn-zero-to-hero: clone the repo and follow the lectures
Updated · written with AI from the project's own documentation and checked against our catalogue data
nn-zero-to-hero is an MIT-licensed course by Andrej Karpathy: a series of YouTube videos in which he writes and trains neural networks from the basics, with the resulting Jupyter notebooks stored in the repository. It suits learners with basic Python who prefer following along with video and code. By the end of this guide you will know how to get the notebooks running and which lecture to start with.
Quick start
- 1Install Python and Jupyter. Make sure Python and Jupyter Notebook are installed. The README does not give installation instructions for them.
- 2Install PyTorch. The notebooks rely on PyTorch. The README does not state a required version, so use a current release that works with your setup.
- 3Clone the repository. Run git clone https://github.com/karpathy/nn-zero-to-hero to download the notebooks.
- 4Start with Lecture 1. Open the first lecture's notebook in lectures/ and watch the matching YouTube video alongside it.
- 5Work through each lecture. Run the code yourself, pausing the video to test ideas, and move to the next lecture once you are comfortable.
- 6Do the exercises. Find the exercises in each lecture's video description, and use the Colab link for lecture 5.
What you need before you start
The README says the course assumes basic Python and a vague recollection of high-school calculus. The notebooks are built on PyTorch, though the README does not state a version. You will also need Python and Jupyter Notebook, since the repository is written in Jupyter Notebook.
- Basic Python knowledge
- Some high-school calculus recollection
- Python and Jupyter Notebook
- PyTorch (implied by the notebooks; no version given in the README)
Get the code: clone the repository
Clone the repository to your machine with git. The README gives this single command. The notebooks live in the lectures/ directory of the clone.
- The lecture notebooks are in lectures/
- Each lecture's notebook is linked from the README
git clone https://github.com/karpathy/nn-zero-to-heroFollow the lectures in order
The course is a sequence of eight lectures, and each one builds on the previous. Lecture 1 covers backpropagation and builds micrograd. Lecture 2 introduces a bigram character-level language model. Lectures 3 to 6 develop the makemore series: an MLP, batch normalization and gradient diagnostics, manual backprop, and a WaveNet-style network. Lectures 7 and 8 build a GPT and a GPT tokenizer.
For each lecture, the README links a YouTube video and a notebook. Watch the video alongside the notebook and run the code yourself rather than only watching. Lecture 4 in the README notes that Batch Normalization is covered, while residual connections and the Adam optimizer are left for later videos.
- Lecture 1: backpropagation and micrograd
- Lecture 2: bigram language model (makemore part 1)
- Lecture 3: MLP language model (makemore part 2)
- Lecture 4: activations, gradients and BatchNorm (makemore part 3)
- Lecture 5: manual backprop through a 2-layer MLP (makemore part 4)
- Lecture 6: WaveNet-style CNN (makemore part 5)
- Lecture 7: building a GPT from scratch
- Lecture 8: building the GPT tokenizer (Byte Pair Encoding)
Use the exercises for lecture 5
The README says each lecture has exercises in its YouTube video description. For lecture 5, the author recommends working through the exercise yourself and pausing the video when you get stuck. The exercise is linked as a Google Colab notebook.
The README calls the material ongoing, so check the repository for updates before you plan a full schedule.
Know what the repository does not give you
The explanations live in the YouTube videos, not in written text. The README points to videos for the explanations, so if you want a text-only reference, this course is not that. The README also says the course may grow into something more respectable, and it describes itself as ongoing. It is a learning resource, not a production library.
What people use it for
- Learning how backpropagation works by building micrograd from the first lecture
- Seeing how a bigram and then an MLP language model are trained on characters
- Following along with a GPT implementation written from scratch in code
- Studying how a tokenizer encodes and decodes text using Byte Pair Encoding
Frequently asked questions
Is nn-zero-to-hero free to use?
Yes. The repository is licensed under MIT, as stated in its README. The course videos are on YouTube and the notebooks are in the repository.
What do I need to know before starting nn-zero-to-hero?
The README says lecture 1 assumes basic Python and a vague recollection of high-school calculus. You should be comfortable with Python before starting.
How do I install nn-zero-to-hero?
There is no installer. Clone the repository with git clone https://github.com/karpathy/nn-zero-to-hero, then open the notebooks in lectures/ with Jupyter Notebook and PyTorch installed.
Is there a text version of the course?
Not in this repository. The README points to YouTube videos for the explanations, so the notebooks are the main text material.
What are alternatives to nn-zero-to-hero?
The README lists fast.ai's Practical Deep Learning course, d2l.ai (Dive into Deep Learning), micrograd and minGPT as comparable projects. Pick d2l.ai if you want a written book and fast.ai if you want a top-down, code-first course.
Is nn-zero-to-hero production-ready?
No. It is a course, not a finished library. The README describes it as ongoing and says it may grow into something more respectable.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Choose nn-zero-to-hero if you know basic Python, learn well from video and code, and want to see backpropagation and GPT built by hand. Skip it if you need a text-only reference, have no Python experience, or need a production-ready library.
Install options & downloads