liveBook · Manning

Matrix inverse

As explained in Math and Architectures of Deep Learning

For a square matrix, the matrix that undoes multiplication by the original matrix when it exists.

For a square matrix A, the inverse A⁻¹ reverses multiplication by A: AA⁻¹ = A⁻¹A = I. It generalizes the scalar reciprocal 1/a and solves a linear system A x = b as x = A⁻¹b. The identity matrix I plays the role of 1, leaving matrices and vectors unchanged when multiplied. section 2.12

From a toy model to a linear system

A toy machine-learning dataset records hardness and sharpness as inputs and threat score as output. Its three training examples produce equations such as 0.11w₀ + 0.09w₁ + b = −0.8, which can be assembled into a compact matrix equation and solved for the parameters. section 2.12

0.11w0 + 0.09w1 + b = –0.8
0.01w0 + 0.02w1 + b = –0.97
0.98w0 + 0.91 w1 + b = 0.89

Inspect the simultaneous equations underlying the toy model before treating them as one matrix equation. section 2.12

Existence and numerical behavior depend on the determinant:

  • A nonzero determinant permits an inverse; a zero determinant makes A singular, so the inverse does not exist and the system cannot be solved exactly. section 2.12.1
  • A determinant close to zero can produce an ill-conditioned system: small input changes may cause large changes in the result. section 2.12.1
  • PyTorch can compute A⁻¹ directly with torch.linalg.inv; diagonalization provides another route for the symmetric example, though matrix inversion is noted as numerically unstable. section 2.15.3

How Math and Architectures of Deep Learning covers it

How deep it goes
Defines inverse identities and determinant conditions, then treats singularity, instability, and PyTorch computation without deriving inversion algorithms.
Examples
Uses toy threat-score equations, a dependent two-equation system, and a three-variable PyTorch system solved by inversion or diagonalization.
What it assumes
Assumes matrix multiplication and scalar reciprocals, while building the correspondence between scalar equations and matrix-form linear systems.
What you can do after
Apply matrix inversion via PyTorch to solve small linear systems while recognizing singularity and numerical instability.
How it connects
Connects matrix inverse with linear systems, determinants, identity matrices, singular matrices, orthogonal matrices, and diagonalization.

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.