Skip to main content

Mathematics and Statistics for AI

Mathematical foundations for AI: linear algebra, calculus, probability, Bayesian statistics, optimization, and information theory applied to machine learning.

This series collects 10 articles (approximately 162 minutes of total reading time), designed for a level Intermediate. The main topics covered are mathematics, statistics, linear algebra, probability.

10Articles162 minTotal reading timeIntermediateLevel
mathematicsstatisticslinear algebraprobabilityoptimization

Series Articles

  1. 1

    01 - Linear Algebra for ML: Vectors, Matrices, and Transformations

    A neural network layer is a matrix multiplication. Dot product, matrices, eigenvalues and SVD, each worked by hand and checked with NumPy.

  2. 2

    02 - Differential Calculus for DL: Gradients and Backpropagation

    How a network learns: chain rule, activation derivatives, backpropagation by hand and a finite-difference gradient check on an XOR network.

  3. 3

    03 - Probability and Statistics: Distributions, Bayesian Inference, and Hypothesis Testing

    Bayes' theorem, key distributions, Naive Bayes, MLE and MAP, the central limit theorem and hypothesis testing, each with a hand calculation and a check.

  4. 4

    04 - Optimization: Gradient Descent, SGD, Adam, and Learning Rate Scheduling

    Why the step size decides convergence: gradient descent, SGD noise, momentum, Adam and learning-rate schedules, tested on a function you can solve by hand.

  5. 5

    05 - Information Theory: Entropy, Cross-Entropy, and KL Divergence

    Entropy, cross-entropy, KL divergence, mutual information and perplexity as one idea: the bits of surprise a model pays, with hand calculations and checks.

  6. 6

    06 - PCA and Dimensionality Reduction: Compressing Data Intelligently

    PCA derived as a constrained maximisation, worked by hand on four points and measured on real data: when it compresses well and when it does not help.

  7. 7

    07 - Loss Functions: MSE, Cross-Entropy, Focal Loss, and Custom Loss

    MSE, MAE, Huber, cross-entropy, focal loss and temperature, with hand calculations and the gradient of a custom loss checked numerically.

  8. 8

    08 - Inferential Statistics: Confidence Intervals and A/B Testing

    Confidence intervals, hypothesis tests, power and the sample size of an A/B test, with hand calculations, simulations and the traps of repeated looks.

  9. 9

    09 - Mathematics of Transformers: Self-Attention and Positional Encoding

    Scaled self-attention derived term by term and checked on three tokens: the sqrt(d_k) factor, multi-head, positional encoding and layer normalisation.

  10. 10

    10 - Data Augmentation and Synthetic Data Generation: Growing Datasets

    Rotation, mixup, CutMix, SMOTE, text and time series and generative models, with experiments on what goes wrong: changed labels and test-set leakage.

Test your knowledge!

Have you read all the articles? Check how much you've learned by taking this series' quizzes.

Take the quiz!