A book-length collection of notes written while studying machine learning: derivations worked out in full, concepts examined from several angles, and summaries of book chapters — from the statistical foundations of learning to graph neural networks.
The notes started as ~100 standalone LaTeX documents, Markdown files and notebooks. They are organised here as a single LaTeX book (11 parts, 67 chapters and three appendices, ~690 pages), with the accompanying code and notebooks.
Part I — Foundations of Statistical Learning
- The Statistical Learning Problem
- Bayes Decision Theory
- Empirical Risk Minimization
- Uniform Convergence and the Symmetrization Lemma
- Generative and Discriminative Models
- Lipschitz Continuity
- Measuring Performance
Part II — Estimation, Inference and Sampling
- Estimators and Sampling Distributions
- Limit Theorems and Statistical Inference
- Covariance and Its Estimation
- Convergence of Events and Probabilities
- Bayesian Reasoning
- Monte Carlo Methods
- The EM Algorithm
Part III — Linear Algebra, Geometry and Calculus
- Adjoints, Projections and Least Squares
- The Singular Value Decomposition
- Principal Component Analysis
- Matrix Factorization
- The Geometry of the Gradient
- Reproducing Kernel Hilbert Spaces
Part IV — Loss Functions, Likelihood and Output Units
- Entropy, Cross-Entropy and Maximum Likelihood
- Output Distributions and their Losses
- Sigmoid and Softmax Output Units
- Surrogate Losses for Classification
Part V — Classical Models
- The Perceptron
- Support Vector Machines
- Support Vector Methods for Regression and Novelty Detection
- Decision Trees
- Ensembles: Bagging, Random Forests and AdaBoost
- Gradient Boosting
- Dynamic Time Warping
- Linear Time Series Models
- Decomposition and Forecasting
Part VI — Neural Networks: Fundamentals and Training
- Feedforward Neural Networks
- Activation Functions and Initialization
- Backpropagation in Multilayer Perceptrons
- Computational Graphs
- Optimization Algorithms for Training
- Normalization Layers
- Dropout
Part VII — Convolutional Networks and Computer Vision
- Convolution and Image Filtering
- Convolutional Layers
- Classic CNN Architectures
- Fully Convolutional Networks and Upsampling
- Object Detection and Instance Segmentation
- Transfer Learning
Part VIII — Recurrent Networks
- Recurrent Networks and Backpropagation Through Time
- Gated Recurrent Networks: LSTM and GRU
- Bidirectional RNNs and Autoregressive Sequence Models
- Case Study: Deep Kalman Filters
Part IX — Language Modeling and Structured Prediction
- Bigram Language Models and Softmax Regression
- A Neural Bigram Model and the Embedding Matrix
- Word Embeddings
- Hierarchical Softmax and Huffman Trees
- Noise-Contrastive Estimation and Negative Sampling
- Structured Prediction, Hidden Markov Models and the Viterbi Algorithm
- Conditional Random Fields
Part X — Contrastive and Self-Supervised Learning
- Contrastive Learning and the InfoNCE Loss
- Self-Supervised Representation Learning in Practice
Part XI — Machine Learning on Graphs
- From Harmonic Functions to Graph Laplacians
- Graph Laplacians and Spectral Methods
- Fourier Analysis
- From the DFT to Graph Neural Networks
- Node Similarity: Path Counts and Random Walks
- Semi-Supervised Learning on Graphs
- Shallow Graph Embedding Methods
- Graph Autoencoders
Appendices
- A. Darboux's Theorem
- B. The Flat Circle ℝ/ℤ
- C. Distributions and Densities
- D. Solutions to the Exercises
Requirements: a TeX Live distribution (2023 or later recommended) with
latexmk. The book uses only standard packages (TikZ/PGFPlots, tcolorbox,
nicematrix, witharrows, forest, listings, algorithmicx, cleveref …).
cd book
make # builds main.pdf (≈ 3 latexmk passes)
make chapter CH=chapters/07-cnn-vision/04-fully-convolutional # one chapter only → chapter.pdf
make cleanA GitHub Actions workflow (.github/workflows/build-book.yml) builds the PDF
on every push. Pushing a version tag (git tag v1.1 && git push origin v1.1)
also publishes it as a release; the latest version is always available
here.
book/
main.tex entry point (book class)
chapters.tex list of parts and chapters (\include)
preamble/ packages.tex, common.tex (shared macros, theorem styles)
frontmatter/ preface
chapters/<part>/ one .tex file per chapter
figures/ raster figures
code/
backpropagation/ a 2-layer network trained with hand-written backprop (+ Adam)
em-three-coin/ EM for the three-coin model vs. direct maximum likelihood
notebooks/ Bayesian reasoning, Gibbs sampling, SVD, convolutions, bigram model
Each chapter file is wrapped in \begin{notechapter} … \end{notechapter},
which opens a TeX group: macros, colours and tcolorbox environments defined
at the top of a chapter stay local to that chapter. Labels are prefixed with
the chapter slug (e.g. \label{svd:eq:rank1}) so that chapters can be
combined without clashes. Inside a chapter, \chapterappendix replaces
\appendix.
pip install -r code/requirements.txt
python code/backpropagation/main.py
python code/em-three-coin/em_eval.py
jupyter lab notebooks/No licence has been chosen yet. Until one is added, the default copyright applies (others may read the repository but not reuse its content). For written material, CC BY 4.0 is a common choice; for the code, MIT.