mxnet.np.linalg.inv¶
-
inv
(a)¶ Compute the (multiplicative) inverse of a matrix.
Given a square matrix a, return the matrix ainv satisfying
dot(a, ainv) = dot(ainv, a) = eye(a.shape[0])
.- Parameters
a ((.., M, M) ndarray) – Matrix to be inverted.
- Returns
ainv – (Multiplicative) inverse of the matrix a.
- Return type
(.., M, M) ndarray
- Raises
MXNetError – If a is not square or inversion fails.
Examples
>>> from mxnet import np >>> a = np.array([[1., 2.], [3., 4.]]) array([[-2. , 1. ], [ 1.5, -0.5]])
Inverses of several matrices can be computed at once:
>>> a = np.array([[[1., 2.], [3., 4.]], [[1, 3], [3, 5]]]) >>> np.linalg.inv(a) array([[[-2. , 1. ], [ 1.5 , -0.5 ]],
- [[-1.2500001 , 0.75000006],
[ 0.75000006, -0.25000003]]])
Did this page help you?
Yes
No
Thanks for your feedback!