Skip to content

About

Notes on Machine Learning: a LaTeX book of study notes, with full derivations, from statistical learning theory, probability and linear algebra through classical models and neural networks (CNNs, RNNs, deep Kalman filters) to language models and graph neural networks. The PDF is built by GitHub Actions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

62 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notes on Machine Learning

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.

📕 Download the PDF

Contents

Part I — Foundations of Statistical Learning

  1. The Statistical Learning Problem
  2. Bayes Decision Theory
  3. Empirical Risk Minimization
  4. Uniform Convergence and the Symmetrization Lemma
  5. Generative and Discriminative Models
  6. Lipschitz Continuity
  7. Measuring Performance

Part II — Estimation, Inference and Sampling

  1. Estimators and Sampling Distributions
  2. Limit Theorems and Statistical Inference
  3. Covariance and Its Estimation
  4. Convergence of Events and Probabilities
  5. Bayesian Reasoning
  6. Monte Carlo Methods
  7. The EM Algorithm

Part III — Linear Algebra, Geometry and Calculus

  1. Adjoints, Projections and Least Squares
  2. The Singular Value Decomposition
  3. Principal Component Analysis
  4. Matrix Factorization
  5. The Geometry of the Gradient
  6. Reproducing Kernel Hilbert Spaces

Part IV — Loss Functions, Likelihood and Output Units

  1. Entropy, Cross-Entropy and Maximum Likelihood
  2. Output Distributions and their Losses
  3. Sigmoid and Softmax Output Units
  4. Surrogate Losses for Classification

Part V — Classical Models

  1. The Perceptron
  2. Support Vector Machines
  3. Support Vector Methods for Regression and Novelty Detection
  4. Decision Trees
  5. Ensembles: Bagging, Random Forests and AdaBoost
  6. Gradient Boosting
  7. Dynamic Time Warping
  8. Linear Time Series Models
  9. Decomposition and Forecasting

Part VI — Neural Networks: Fundamentals and Training

  1. Feedforward Neural Networks
  2. Activation Functions and Initialization
  3. Backpropagation in Multilayer Perceptrons
  4. Computational Graphs
  5. Optimization Algorithms for Training
  6. Normalization Layers
  7. Dropout

Part VII — Convolutional Networks and Computer Vision

  1. Convolution and Image Filtering
  2. Convolutional Layers
  3. Classic CNN Architectures
  4. Fully Convolutional Networks and Upsampling
  5. Object Detection and Instance Segmentation
  6. Transfer Learning

Part VIII — Recurrent Networks

  1. Recurrent Networks and Backpropagation Through Time
  2. Gated Recurrent Networks: LSTM and GRU
  3. Bidirectional RNNs and Autoregressive Sequence Models
  4. Case Study: Deep Kalman Filters

Part IX — Language Modeling and Structured Prediction

  1. Bigram Language Models and Softmax Regression
  2. A Neural Bigram Model and the Embedding Matrix
  3. Word Embeddings
  4. Hierarchical Softmax and Huffman Trees
  5. Noise-Contrastive Estimation and Negative Sampling
  6. Structured Prediction, Hidden Markov Models and the Viterbi Algorithm
  7. Conditional Random Fields

Part X — Contrastive and Self-Supervised Learning

  1. Contrastive Learning and the InfoNCE Loss
  2. Self-Supervised Representation Learning in Practice

Part XI — Machine Learning on Graphs

  1. From Harmonic Functions to Graph Laplacians
  2. Graph Laplacians and Spectral Methods
  3. Fourier Analysis
  4. From the DFT to Graph Neural Networks
  5. Node Similarity: Path Counts and Random Walks
  6. Semi-Supervised Learning on Graphs
  7. Shallow Graph Embedding Methods
  8. Graph Autoencoders

Appendices

  • A. Darboux's Theorem
  • B. The Flat Circle ℝ/ℤ
  • C. Distributions and Densities
  • D. Solutions to the Exercises

Building the book

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 clean

A 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.

Repository layout

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

Writing conventions for chapters

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.

Code and notebooks

pip install -r code/requirements.txt
python code/backpropagation/main.py
python code/em-three-coin/em_eval.py
jupyter lab notebooks/

Licence

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.

About

Notes on Machine Learning: a LaTeX book of study notes, with full derivations, from statistical learning theory, probability and linear algebra through classical models and neural networks (CNNs, RNNs, deep Kalman filters) to language models and graph neural networks. The PDF is built by GitHub Actions.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages