ZadeNor AI
Back to Blog
AI

karpathy/nn-zero-to-hero: Trending on GitHub

May 23, 2026
5 min
385 views
By ZadeNor AI Team
karpathy/nn-zero-to-hero: Trending on GitHub

karpathy/nn-zero-to-hero: Trending on GitHub

Neural Networks: Zero to Hero

A Comprehensive Guide to Building and Training Neural Networks from Scratch

In the rapidly evolving landscape of artificial intelligence, neural networks have emerged as a crucial component of machine learning. These complex systems have revolutionized the way we approach tasks such as image recognition, natural language processing, and predictive modeling. However, building and training neural networks can be a daunting task, especially for those without a strong background in mathematics and computer science.

That's where the karpathy/nn-zero-to-hero repository comes in. This comprehensive guide, created by Andrej Karpathy, a renowned expert in deep learning, provides a step-by-step introduction to building and training neural networks from scratch. In this article, we'll delve into the world of neural networks, exploring the key concepts, techniques, and tools used in this repository.

Lecture 1: The Spelled-Out Intro to Neural Networks and Backpropagation

The first lecture in the repository is an introduction to neural networks and backpropagation. Karpathy assumes a basic knowledge of Python and a vague recollection of calculus from high school. The lecture covers the following topics:

  • Neural Network Basics: Karpathy introduces the concept of neural networks, explaining how they work and how they can be used for various tasks.
  • Backpropagation: The lecture covers the backpropagation algorithm, which is used to train neural networks. Karpathy explains how backpropagation works and how it can be used to optimize neural network weights.

The lecture includes a Jupyter notebook file and a micrograd GitHub repository, which can be used to practice and experiment with neural networks.

Lecture 2: The Spelled-Out Intro to Language Modeling

The second lecture in the repository is an introduction to language modeling. Karpathy explains how language models work and how they can be used for various tasks such as text generation and language translation.

The lecture covers the following topics:

  • Language Modeling Basics: Karpathy introduces the concept of language modeling, explaining how it works and how it can be used for various tasks.
  • Torch.Tensor: The lecture covers the Torch.Tensor class, which is used to represent tensors in PyTorch.
  • Language Model Training: Karpathy explains how to train a language model using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with language models.

Lecture 3: Building Makemore Part 2: MLP

The third lecture in the repository is a continuation of the language modeling tutorial. Karpathy explains how to build a multilayer perceptron (MLP) using PyTorch.

The lecture covers the following topics:

  • MLP Basics: Karpathy introduces the concept of MLPs, explaining how they work and how they can be used for various tasks.
  • Model Training: Karpathy explains how to train an MLP using PyTorch.
  • Hyperparameter Tuning: The lecture covers how to tune hyperparameters using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with MLPs.

Lecture 4: Building Makemore Part 3: Activations & Gradients, BatchNorm

The fourth lecture in the repository is a continuation of the MLP tutorial. Karpathy explains how to implement activations and gradients using PyTorch.

The lecture covers the following topics:

  • Activations: Karpathy introduces the concept of activations, explaining how they work and how they can be used for various tasks.
  • Gradients: The lecture covers how to compute gradients using PyTorch.
  • BatchNorm: Karpathy explains how to implement batch normalization using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with batch normalization.

Lecture 5: Building Makemore Part 4: Becoming a Backprop Ninja

The fifth lecture in the repository is a continuation of the batch normalization tutorial. Karpathy explains how to implement backpropagation using PyTorch.

The lecture covers the following topics:

  • Backpropagation: Karpathy introduces the concept of backpropagation, explaining how it works and how it can be used for various tasks.
  • Torch.Tensor: The lecture covers how to use Torch.Tensor to represent tensors in PyTorch.
  • Backpropagation Implementation: Karpathy explains how to implement backpropagation using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with backpropagation.

Lecture 6: Building Makemore Part 5: Building WaveNet

The sixth lecture in the repository is a continuation of the backpropagation tutorial. Karpathy explains how to build a WaveNet using PyTorch.

The lecture covers the following topics:

  • WaveNet Basics: Karpathy introduces the concept of WaveNet, explaining how it works and how it can be used for various tasks.
  • Torch.nn: The lecture covers how to use Torch.nn to represent neural networks in PyTorch.
  • WaveNet Implementation: Karpathy explains how to implement WaveNet using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with WaveNet.

Lecture 7: Let's Build GPT: from Scratch, in Code, Spelled Out

The seventh lecture in the repository is a continuation of the WaveNet tutorial. Karpathy explains how to build a Generatively Pretrained Transformer (GPT) using PyTorch.

The lecture covers the following topics:

  • GPT Basics: Karpathy introduces the concept of GPT, explaining how it works and how it can be used for various tasks.
  • Torch.nn: The lecture covers how to use Torch.nn to represent neural networks in PyTorch.
  • GPT Implementation: Karpathy explains how to implement GPT using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with GPT.

Lecture 8: Let's Build the GPT Tokenizer

The eighth and final lecture in the repository is a continuation of the GPT tutorial. Karpathy explains how to build a GPT tokenizer using PyTorch.

The lecture covers the following topics:

  • Tokenizer Basics: Karpathy introduces the concept of tokenizers, explaining how they work and how they can be used for various tasks.
  • Torch.nn: The lecture covers how to use Torch.nn to represent neural networks in PyTorch.
  • Tokenizer Implementation: Karpathy explains how to implement a tokenizer using PyTorch.

The lecture includes a Jupyter notebook file and a makemore GitHub repository, which can be used to practice and experiment with tokenizers.

In conclusion, the karpathy/nn-zero-to-hero repository provides a comprehensive guide to building and training neural networks from scratch. The repository covers a wide range of topics, from the basics of neural networks to the implementation of complex architectures such as WaveNet and GPT. The repository includes a series of lectures, each of which covers a specific topic in detail. The lectures include Jupyter notebook files and GitHub repositories, which can be used to practice and experiment with the concepts and techniques covered in the lectures.


Source: https://github.com/karpathy/nn-zero-to-hero

About the Author

ZadeNor AI Team is a leading expert in AI, contributing to cutting-edge research and development in the field.