liveBook · Manning

L2 norm

As explained in Math and Architectures of Deep Learning

The Euclidean norm measuring a vector's length by squaring components, summing them, and taking the square root.

The L2 norm measures a vector’s length or magnitude. For a vector x, ||x||₂ = √(x₁² + x₂² + ... + xₙ²): square each component, sum the squares, and take the square root. Its square, ||x||₂², equals the dot product x·x. section 2.5.4

Geometrically, the L2 norm of a two-dimensional vector is the hypotenuse of the right triangle formed by its components. The same length intuition extends to higher-dimensional vectors. section 2.5.5

The L2 norm supports several machine-learning interpretations:

  • Treats the difference between a model’s output vector and target vector as an error vector whose length measures overall error. section 2.5.4
  • Normalizes a nonzero vector by dividing every component by its length, producing a unit vector with length 1 that typically represents direction. section 2.5.5
  • Provides a regularization penalty when added to a loss, discouraging neural networks from learning large weight values. section 9.3.6

Model error as vector length

Collect a model’s outputs and corresponding ground truths across a training set. Their differences form an error vector; minimizing its L2 norm minimizes the overall distance between predictions and targets. Using the squared L2 norm instead removes the final square root while preserving the dot-product interpretation. section 2.5.4 section 2.5.5

How Math and Architectures of Deep Learning covers it

How deep it goes
Defines the formula, dot-product relationship, geometric meaning, normalization use, and regularization role without deriving matrix norms.
Examples
Uses error vectors across training data, right-triangle geometry, unit-vector normalization, and weight penalties.
What it assumes
Assumes vectors and dot products while building geometric intuition from right-triangle lengths.
What you can do after
Evaluate vector magnitude, interpret prediction error, normalize vectors, and understand L2 weight regularization.
How it connects
Connects vectors, dot products, unit vectors, model error, loss functions, and L2 regularization.

Also explained in

Compare how 3 books explain l2 norm →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Math and Architectures of Deep Learning. The section links point to the parts of the book it draws on.