aesara.tensor.nlinalg.pinv

Contents

aesara.tensor.nlinalg.pinv#

aesara.tensor.nlinalg.pinv(x, hermitian=False)[source]#

Computes the pseudo-inverse of a matrix A.

The pseudo-inverse of a matrix A, denoted A^+, is defined as: “the matrix that ‘solves’ [the least-squares problem] Ax = b,” i.e., if \bar{x} is said solution, then A^+ is that matrix such that \bar{x} = A^+b.

Note that Ax=AA^+b, so AA^+ is close to the identity matrix. This method is not faster than matrix_inverse. Its strength comes from that it works for non-square matrices. If you have a square matrix though, matrix_inverse can be both more exact and faster to compute. Also this op does not get optimized into a solve op.