Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Neural Networks, Built and Explained

A learning notebook by Satish Bajagain, following Andrej Karpathy’s Zero to Hero.

These are the explanations I collected while learning: comments beside the code, handwritten derivations, small experiments, and the steps that made an idea click.

I have completed the seven lessons represented here, including the character-level GPT implementation. The collection follows a path from scalar autograd and character models to a decoder transformer. It accompanies my portfolio and independent sleep-stage research and my completed GPT-from-scratch project. These are learning implementations following Karpathy, with original explanations and derivations; they are not peer-reviewed research results.

Read the notebooks

NotebookExplore
01 · MicrogradDerivatives, computational graphs and gradient descent
02 · BigramsCounts, probability, likelihood and learning
03 · Embeddings and the MLPRepresentations, context and generalization
04 · Activations and normalizationInitialization, saturation and training diagnostics
05 · Backpropagation by handHandwritten mathematics and manual gradients
06 · Hierarchical contextProgressively combining characters
07 · Decoder transformersGeneration, attention and transformer components

A short study session

Start with a recall question, think through an answer, then return to the original explanation. For a worked example, follow the matrix-gradient reading guide alongside the handwritten derivation.

The notebooks preserve the original wording, comments, intermediate attempts and saved outputs. Additional reading guides and recall answers are labeled separately. About these notes.

Download the notebooks with their images, data and scripts.