Books, Courses & Where to Follow Research

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Machine learning moves faster than most books can be printed. The ideas (gradient descent, regularisation, convolution, attention) change slowly, but the libraries that implement them change every few months, so a book that explains an idea beautifully can still contain code that no longer runs. This page recommends material for the ideas, points to the official documentation for the code, and lists the specific statements in older books and tutorials that are now wrong.

The pages of this section target Python 3.13, PyTorch 2.15, TensorFlow 2.21 with Keras 3.15 and scikit-learn 1.9. The recommendations and the state of each project were checked on 2026-10-30. Where this page and a book disagree about an API, the official documentation of the version you install wins.

How to choose what to read

Match the resource to the question you have:

  • "How does this work, and why?" Read a theory text or lecture notes: the maths and the intuition are stable for decades.

  • "How do I write it today?" Read the official documentation and release notes of the library version you install, not a book.

  • "What is state of the art?" Read recent papers and the maintained community collections described in Where to follow research.

  • "Why does my model not train?" Read practitioner playbooks such as Deep Learning Tuning Playbook, which are about habits rather than APIs.

A good order for a newcomer is: a gentle foundations course, then one project-driven hands-on book (type the code, but check every API against the official docs), then a rigorous theory text for the topics you will use, then papers.

Free books and notes

These are the best free references and the ones most worth recommending. Their licences differ: read them online, and follow each site’s terms for downloading.

Resource Best for Notes

Goodfellow, Bengio and Courville, Deep Learning (MIT Press, 2016), free HTML version

The mathematical foundations of deep learning: linear algebra and probability review, optimisation, regularisation, CNNs, RNNs, autoencoders

A reference more than a tutorial. It predates attention and transformers, diffusion models and modern training recipes, so pair it with Topics the books do not cover.

Zhang, Lipton, Li and Smola, Dive into Deep Learning (d2l.ai, 1.0.3)

Theory and runnable code side by side, from linear regression to transformers

Offers PyTorch, MXNet, JAX and TensorFlow tabs. MXNet is retired, so use the PyTorch tab (or JAX). It is the closest thing to a living, free textbook.

Prince, Understanding Deep Learning (MIT Press, 2023), free PDF

Clear modern treatment, including transformers, diffusion, graph networks and reinforcement learning, with many figures

Framework-agnostic: notebooks accompany it, but the book itself has no library code to go stale.

Bishop and Bishop, Deep Learning: Foundations and Concepts (Springer, 2024)

A rigorous modern probabilistic treatment

The successor in spirit to Bishop’s Pattern Recognition and Machine Learning.

Sutton and Barto, Reinforcement Learning: An Introduction, 2nd edition, free PDF

The standard text on reinforcement learning: MDPs, value functions, temporal-difference learning, policy gradients

The authors' site is served over plain HTTP only. See Reinforcement Learning.

Stanford CS229 lecture notes

Classical machine learning with derivations: linear models, SVM, EM, learning theory

Notes are terse but precise.

Stanford CS231n notes and assignments

Convolutional networks, backpropagation, optimisation and practical training advice, with programming assignments

The course material has been refreshed to cover transformers and diffusion.

Google Machine Learning Crash Course

A free, short, practical introduction with exercises

A good first step before a longer book.

Google Deep Learning Tuning Playbook

A methodology for tuning deep-learning models: choosing architecture, batch size, optimiser, and running experiments

Habits rather than code. See Deep Learning Tuning Playbook.

Books worth buying

Paid books are worth it when they are project-driven and recent. The list below is deliberately short.

  • Aurélien Géron, Hands-On Machine Learning with Scikit-Learn and PyTorch (O’Reilly, 2025). The most current practical book: an end-to-end project, training deep networks, CNNs, RNNs, attention and transformers, autoencoders, GANs and diffusion, and reinforcement learning, with a modern PyTorch loop. It targets PyTorch 2.8 and scikit-learn 1.5 or newer, so see Where older books and tutorials are outdated for what has changed since.

  • Jay Alammar and Maarten Grootendorst, Hands-On Large Language Models (O’Reilly, 2024). Illustrated explanations of tokens, embeddings, attention and fine-tuning. It is the natural bridge to the AI section; its LangChain examples use APIs that have since been replaced.

  • Rao and McMahan, Natural Language Processing with PyTorch (O’Reilly, 2019). Good teaching of the NLP pipeline (vocabulary, vectoriser, dataset) and of embeddings and sequence models. It predates the transformer era in practice.

  • Marsland, Machine Learning: An Algorithmic Perspective, 2nd edition (CRC Press, 2015). The strongest theory-with-NumPy text among the older books: derivations and from-scratch implementations of MLPs, SVMs, trees, ensembles, EM and Gaussian mixtures, HMMs, Kalman filters, MCMC, Gaussian processes and reinforcement learning. Read it for the algorithms and ignore the Python 2 code.

Older books you may meet

The following books are still found in libraries and bookshelves. Each has parts that remain valuable and parts that are now wrong. The table gives the target versions of the book and what to take and what to rewrite.

Book Targets Still useful for Out of date

Géron, Hands-On Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd edition (O’Reilly, 2019)

TensorFlow 2.0 with Keras 2, scikit-learn 0.20

Sequential, Functional and subclassing APIs, callbacks, custom losses, layers and training loops, tf.data, CNN architectures, transfer learning

Keras 2 idioms: SGD(lr=), predict_classes, .h5 saving, keras.wrappers.scikit_learn, feature columns, Estimators, fit_generator, multi_class=; no Keras 3, LiteRT or tf.distribute

Géron, Hands-On Machine Learning with Scikit-Learn and TensorFlow (O’Reilly, 2017)

TensorFlow 1.0, scikit-learn 0.18

The machine-learning taxonomy and challenges, the project checklist, the gradient-descent family, the SVM dual problem, automatic differentiation

Graph mode throughout (Session, feed_dict, tf.contrib, queues), fetch_mldata, Imputer; OpenAI Gym became Gymnasium

Vasilev and others, Python Deep Learning, 2nd edition (Packt, 2019)

TensorFlow 1.12, PyTorch 1.0, Keras 2.2.4

Backpropagation maths, detection and segmentation, GANs and VAEs, reinforcement-learning theory, the same model in three frameworks

torch.autograd.Variable, pretrained=True, standalone keras imports, TensorFlow 1 sessions, the old gym API

Skansi, Introduction to Deep Learning (Springer, 2018)

Python 3 with standalone Keras 2 on TensorFlow 1

A gentle and rigorous theory path: maths prerequisites, the perceptron and delta rule, step-by-step backpropagation, vanishing gradients, word2vec

Standalone Keras imports; no PyTorch, attention or transformers

Subramanian, Deep Learning with PyTorch (Packt, 2018)

PyTorch 0.3

A fundamentals overview, transfer learning with torchvision, style transfer

Variable as a core building block, torchtext.data.Field and BucketIterator, obsolete CUDA install commands

Zadeh and Ramsundar, TensorFlow for Deep Learning (O’Reilly, 2018)

TensorFlow 1.0 and 1.1

Deep-learning building blocks, a tour of landmark models, a tensor-maths primer on shapes and broadcasting

TensorFlow 1 sessions throughout; an obsolete framework survey

Hope, Resheff and Lieder, Learning TensorFlow (O’Reilly, 2017)

TensorFlow 1.0 and 1.1

The computation-graph mental model, which helps explain tf.function

tf.Session, placeholders, tf.contrib, TFLearn, queue pipelines, tf.app.flags, SavedModelBuilder, load_boston

Raschka, Python Machine Learning (Packt, 2015)

scikit-learn 0.15, Theano, early Keras

From-scratch perceptron, Adaline and gradient descent, preprocessing, PCA and LDA, nested cross-validation

sklearn.cross_validation, grid_search, lda, Imputer, OneHotEncoder(categorical_features=), Python 2 print, Theano, early Keras arguments

Mishra, PyTorch Recipes (Apress, 2019)

PyTorch 0.3 and 0.4

A recipe-style topic list

Variable with volatile, code reproduced as images

LazyProgrammer, Deep Learning in Python (self-published, 2016)

Python 2, NumPy, Theano, TensorFlow 0.x

A compact NumPy backpropagation sketch

xrange, print x, Theano (discontinued), TensorFlow 0 placeholders

Treat the "Out of date" column as a translation list: when code from one of these books fails, the section below says what replaced the failing line.

Where older books and tutorials are outdated

The statements below were true when the books were written and are false for the versions this section targets. They are grouped by library and dated to the release that changed them. The framework pages repeat them next to the code they affect.

Python and general

Older advice Today

Python 2, print x, xrange, import pylab

Python 3 only; use print(), range, and import matplotlib.pyplot as plt. Python 3.13 is the common target of this section.

conda install pytorch -c soumith, cuda80

Install from the selector on the PyTorch site. PyTorch publishes no official conda packages after 2.5: use pip wheels or conda-forge.

Theano, TFLearn, Caffe as current frameworks

Discontinued or unmaintained. The maintained frameworks are PyTorch, JAX and TensorFlow with Keras 3.

OpenAI Gym

Gymnasium is the maintained fork and the current API (see Reinforcement Learning).

SciKeras as the way to use Keras models in scikit-learn

SciKeras is archived (last release 0.13.0, April 2024). Use Keras 3’s built-in keras.wrappers.SKLearnClassifier, SKLearnRegressor and SKLearnTransformer. For PyTorch, skorch is maintained.

Papers with Code as the place to find results

Sunset in July 2025; the old address redirects to Hugging Face Trending Papers.

PyTorch

Older idiom Replacement Changed in

torch.autograd.Variable, volatile=True

Plain tensors; torch.no_grad() or torch.inference_mode()

0.4

loss.data[0]

loss.item()

0.4

F.sigmoid, F.tanh

torch.sigmoid, torch.tanh

0.4 onwards

models.resnet50(pretrained=True)

models.resnet50(weights=ResNet50_Weights.DEFAULT); pretrained= is deprecated, not removed, and torchvision 0.29 still accepts it with a warning

Deprecated in torchvision 0.13

torch.save(model) then torch.load(path)

Save the state_dict, and load with the default weights_only=True; whole-model pickles fail unless you allowlist the classes with add_safe_globals

2.6 (default flipped)

torch.jit.trace and torch.jit.script (TorchScript), as taught in the 2025 edition of Géron

TorchScript is deprecated; use torch.export, and ExecuTorch instead of the embedded runtime

2.10 (warnings visible from 2.14)

torch.cuda.amp.autocast, torch.cuda.amp.GradScaler

torch.autocast("cuda") and torch.amp.GradScaler("cuda"); bfloat16 needs no scaler

Deprecated in recent releases

torch.onnx.export with the TorchScript exporter and a hard-coded opset

The torch.export-based exporter is the default; dynamic_axes is deprecated in favour of dynamic_shapes; do not hard-code an opset

2.9, with the old fallback removed in 2.11

torch.ao.quantization

torchao (quantize_ and its config classes)

Deprecated; still present in 2.15

torchtext.data.Field, BucketIterator

Hugging Face tokenizers and datasets, or plain Dataset classes; torchtext is archived

Archived 2025

torch.cholesky, torch.qr

torch.linalg.cholesky, torch.linalg.qr

Removed in 2.14

Named tensors

Ordinary tensors with documented dimension order

Removed in 2.13

TorchServe as the standard server

Archived in August 2025 with no security patches; see Deploying & Serving Models

2025

TensorFlow and Keras

Older idiom Today

tf.Session, tf.placeholder, feed_dict, tf.contrib

TensorFlow 2 is eager by default; wrap hot paths in tf.function. tf.contrib was removed in TensorFlow 2.0.

Queue runners and tf.train.* input pipelines

tf.data.

Estimators and feature columns

Keras layers and preprocessing layers. tf.estimator was removed in TensorFlow 2.16.

from keras.layers.core import Dense, SGD(lr=..., decay=...)

from keras import layers, SGD(learning_rate=...) with a learning-rate schedule object.

model.predict_classes

np.argmax(model.predict(x), axis=-1), or a threshold for binary outputs.

fit_generator

fit accepts datasets and generators.

model.save("model.h5")

Save as .keras; weights go in .weights.h5; the SavedModel format is produced with model.export() for serving, and load_model() cannot read a SavedModel.

tf.keras is Keras 2

tf.keras is Keras 3 since TensorFlow 2.16. Keras 2 needs pip install tf_keras and TF_USE_LEGACY_KERAS=1 set before TensorFlow is imported.

ImageDataGenerator

Deprecated; use image_dataset_from_directory and the Random* preprocessing layers.

tf.keras.wrappers.scikit_learn

Removed in TensorFlow 2.13; use keras.wrappers.

tf.lite.Interpreter

Use ai_edge_litert; tf.lite still exists in 2.21 with no announced removal version.

TensorBoard bundled with TensorFlow

From TensorFlow 2.21 install it yourself with pip install tensorboard.

Native Windows GPU support

Ended at TensorFlow 2.10; use WSL2.

TensorFlow Addons, KerasCV

Both archived in March 2026; KerasNLP is now KerasHub.

The tensorflow.org site itself lags the releases: many pages still display version 2.16.1, and some guides do not mention Keras 3. Prefer the release notes and the keras.io API pages when they disagree with a tutorial.

scikit-learn

Older idiom Today

sklearn.cross_validation, sklearn.grid_search, sklearn.learning_curve

sklearn.model_selection.

sklearn.lda.LDA

sklearn.discriminant_analysis.LinearDiscriminantAnalysis.

Imputer

sklearn.impute.SimpleImputer.

OneHotEncoder(categorical_features=...)

ColumnTransformer with OneHotEncoder.

fetch_mldata, load_boston

Removed; use fetch_openml and the California housing or diabetes datasets.

LogisticRegression(multi_class=...)

Deprecated; use the default behaviour, or wrap in OneVsRestClassifier.

sklearn.externals.six, np.infty

Removed from scikit-learn and NumPy 2 respectively; use np.inf.

Raw pickle for persistence

Use skops, joblib with the same library versions, or export to ONNX; there is still no supported way to load a model trained by another scikit-learn version.

Semi-supervised example with SVC(probability=True)

That option is deprecated in 1.9 (removal in 1.11); use LogisticRegression or CalibratedClassifierCV.

Topics the books do not cover

Several topics that matter in 2026 appear in none of the older books, and only partly in the newest one. Learn them from the official documentation:

  • Keras 3 multi-backend and its saving rules, model.export, LiteRT.

  • torch.export, ExecuTorch, torchao, FSDP2 and DTensor, torch.accelerator, weights_only loading, the roughly two-month PyTorch release cadence.

  • scikit-learn callbacks and Array API dispatch (both experimental).

  • ONNX opset and runtime alignment: ONNX Runtime lags the ONNX specification, so export with an opset no newer than the runtime supports.

  • The landscape of archived projects: TorchServe, torchtext, torchtune, SciKeras, TensorFlow Addons and KerasCV.

Courses

  • Google Machine Learning Crash Course: short, free, exercises included.

  • Stanford CS229 (machine learning) and CS231n (convolutional networks and vision): public notes and assignments.

  • fast.ai Practical Deep Learning for Coders: top-down, code first, PyTorch based.

  • Dive into Deep Learning (d2l.ai): usable as a course, with notebooks.

  • Hugging Face courses on transformers, diffusion and reinforcement learning, which pair with the fine-tuning pages of the AI section.

  • Official tutorials: the PyTorch tutorials, the TensorFlow and Keras guides on keras.io, and the scikit-learn user guide are the most reliable code references, with the staleness caveats above.

Where to follow research

  • arXiv (cs.LG, cs.CV, cs.CL, stat.ML) is where nearly every paper appears first. Read the abstract and figures, then decide whether the paper is worth an hour.

  • Hugging Face Trending Papers replaced Papers with Code, which was sunset in July 2025. It lists popular papers with links to models, datasets and Spaces.

  • Conference proceedings (NeurIPS, ICML, ICLR, CVPR, ACL) publish the peer-reviewed versions.

  • Distill-style explainers and the Google AI, DeepMind, Meta AI and Anthropic research blogs give readable summaries.

  • Library release notes (PyTorch, TensorFlow, Keras, scikit-learn) are the best way to keep code current; subscribe to the GitHub releases.

  • Benchmarks quickly become stale or contaminated; see Benchmarks & Leaderboards for how to read them critically.

A useful reading habit for papers is three passes: abstract and figures, then method and results, then (only if needed) proofs and appendices. Always look for the ablation table, which shows which parts of the method matter, and for whether the code is released.

A reading path

References