A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.linalg.cond.html below:

jax.numpy.linalg.cond — JAX documentation

jax.numpy.linalg.cond#
jax.numpy.linalg.cond(x, p=None)[source]#

Compute the condition number of a matrix.

JAX implementation of numpy.linalg.cond().

The condition number is defined as norm(x, p) * norm(inv(x), p). For p = 2 (the default), the condition number is the ratio of the largest to the smallest singular value.

Parameters:
  • x (ArrayLike) – array of shape (..., M, N) for which to compute the condition number.

  • p – the order of the norm to use. One of {None, 1, -1, 2, -2, inf, -inf, 'fro'}; see jax.numpy.linalg.norm() for the meaning of these. The default is p = None, which is equivalent to p = 2. If not in {None, 2, -2} then x must be square, i.e. M = N.

Returns:

array of shape x.shape[:-2] containing the condition number.

Examples

Well-conditioned matrix:

>>> x = jnp.array([[1, 2],
...                [2, 1]])
>>> jnp.linalg.cond(x)
Array(3., dtype=float32)

Ill-conditioned matrix:

>>> x = jnp.array([[1, 2],
...                [0, 0]])
>>> jnp.linalg.cond(x)
Array(inf, 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.4