Skip to main content

📝 Mathematical Foundations

Mathematical foundations are the tools used to describe data, models, learning, and uncertainty in machine learning.

Vector norms​

For a weight vector ww, ∥w∥\lVert w\rVert means its norm: a single number that measures the vector's size. The subscript specifies which kind of size to use.

For example, if w=[3,4]w=[3,4], its L2 norm is its usual Euclidean length:

∥w∥2=32+42=5\lVert w\rVert_2 = \sqrt{3^2+4^2} = 5
NotationMeaningCommon ML use
∥w∥1\lVert w\rVert_1Sum of absolute values: ∑j∣wj∣\sum_j \lvert w_j\rvertL1 regularization; can encourage sparse weights
∥w∥2\lVert w\rVert_2Euclidean length: ∑jwj2\sqrt{\sum_j w_j^2}Measures the overall size of a weight vector
∥w∥22\lVert w\rVert_2^2Squared L2 norm: ∑jwj2\sum_j w_j^2L2 regularization / weight decay

Without a subscript, the intended norm must come from context. In regularization, ∥w∥2\lVert w\rVert_2 is the square root of the sum of squared weights, while ∥w∥22\lVert w\rVert_2^2 is that sum itself.

AreaWhy it matters in ML
Probability & StatisticsDescribes uncertainty, data distributions, likelihoods, and model confidence
Linear AlgebraRepresents data and model parameters with vectors, matrices, and tensors
Calculus & OptimizationProvides gradients and optimization methods for training models
Information TheoryExplains losses such as cross-entropy and measures distribution differences