Core library docs

The official reference for the libraries you'll use daily. Read the user guides, not just the API reference.

  • scikit-learn user guide Classical ML The gold standard for classical-ML reference code. Every algorithm has a worked example, a "tips on practical use" subsection, and references to the original papers. The user guide alone is a full course.
  • PyTorch documentation Deep learning The framework most modern research uses. Start with the 60-minute blitz, then read the autograd notes — understanding autograd well is what separates beginners from intermediate users.
  • JAX documentation Deep learning Google's NumPy-on-GPU with first-class transformations (jit, vmap, grad). Increasingly the choice for research; the Thinking in JAX guide is essential.
  • Hugging Face docs Transformers The default entry point for pretrained transformers, datasets, and serving. The "transformers" library is the de-facto standard for working with LLMs and vision transformers in Python.
  • PyTorch Lightning Training scaffolding Removes the boilerplate from PyTorch training loops. If you find yourself re-writing the same trainer for every project, this is the abstraction to learn.
  • SciPy Scientific Statistical tests, special functions, optimization, sparse matrices. Often the right tool when scikit-learn is too high-level and NumPy is too low.

Books with executable code

Textbooks where every figure has a Jupyter notebook behind it. Best for learning by typing along.

  • Dive Into Deep Learning Free Book Free textbook with executable code for every concept (PyTorch / TF / JAX / MXNet). The closest thing to a comprehensive DL textbook with runnable examples. Updated regularly.
  • Hands-On ML — Aurélien Géron Paid Book "Hands-On Machine Learning with Scikit-Learn, Keras & TensorFlow", 3rd ed. The notebooks are free even if you don't buy the book; the most-recommended practical ML book.
  • Murphy — PML notebooks Free Notebooks Companion code to Murphy's "Probabilistic ML" textbooks. Hundreds of notebooks covering Bayesian methods, generative models, and more.

Code-along tutorials

Where you watch (or read) someone build a model from scratch and follow along. The fastest way to internalize a technique.

  • Karpathy — Neural Networks: Zero to Hero Free Video + code Andrej Karpathy's full video course building from scratch: micrograd → makemore → GPT. The single best resource for understanding modern transformers at the implementation level.
  • nanoGPT Free Repo Karpathy's ~300-line GPT implementation. Trains real models. Read the file top-to-bottom — every line teaches something about transformer training.
  • Annotated Deep Learning Paper Implementations Free Repo ~150 paper implementations with side-by-side annotations. Best when you've read a paper and want to see exactly how the math becomes code.
  • The Annotated Transformer Free Article Harvard NLP's annotated re-implementation of "Attention Is All You Need" — every equation in the paper paired with the PyTorch line that implements it.

Worked examples

Example-by-example reference code. Best for "I want to do X — show me the canonical way".

  • scikit-learn examples gallery Free Gallery Hundreds of small worked examples with plots. Filter by topic. Excellent for finding the right tool for a specific problem.
  • pytorch/examples Free Repo Official PyTorch example repository — MNIST, ImageNet, RL, language modelling, GAN. Reference for idiomatic PyTorch patterns.
  • Keras code examples Free Gallery Curated, self-contained Keras / TF examples across every modality (vision, audio, NLP, RL, generative). Each is short and runnable end-to-end.
  • Hugging Face examples Free Repo Official scripts for every transformer task — classification, QA, summarisation, translation, generation. The starting point for any fine-tuning work.

Reading great code

Open-source projects worth reading for their own sake — not just to use, but to learn from how they're written.

  • scikit-learn source Free Source A model of careful Python: consistent API, thorough docstrings, regression tests for every estimator. Reading sklearn/linear_model/_base.py teaches more about API design than most tutorials.
  • transformers — model implementations Free Source Every major transformer architecture (BERT, GPT, Llama, ViT, …) implemented in PyTorch with consistent structure. Reading two implementations side-by-side is the best way to learn an architecture.
  • Flax — JAX neural network library Free Source Compact, functional JAX library. Excellent example of how to design composable neural-network APIs without classes-everywhere.
  • llm.c — Karpathy Free Source GPT-2 training in pure C/CUDA. ~1000 lines. Read this when you want to see what frameworks actually compile down to.

Papers with implementations

Finding the implementation alongside the paper.

  • Papers With Code Free Index Papers indexed by task with linked implementations and benchmark rankings. The best single place to find a strong baseline for any benchmark.
  • Annotated DL Paper Implementations Free Repo Side-by-side paper text + clean PyTorch implementation for ~150 influential papers. Listed twice because it's that useful.