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