Compute the sign and (natural) logarithm of the determinant of an array.
JAX implementation of numpy.linalg.slogdet()
.
a (ArrayLike) – array of shape (..., M, M)
for which to compute the sign and log determinant.
method (str | None) –
the method to use for determinant computation. Options are
'lu'
(default): use the LU decomposition.
'qr'
: use the QR decomposition.
A tuple of arrays (sign, logabsdet)
, each of shape a.shape[:-2]
sign
is the sign of the determinant.
logabsdet
is the natural log of the determinant’s absolute value.
SlogdetResult
Examples
>>> a = jnp.array([[1, 2], ... [3, 4]]) >>> sign, logabsdet = jnp.linalg.slogdet(a) >>> sign # -1 indicates negative determinant Array(-1., dtype=float32) >>> jnp.exp(logabsdet) # Absolute value of determinant Array(2., dtype=float32)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3