jax.numpy.argmin
Contents
jax.numpy.argmin#
- jax.numpy.argmin(a,axis=None,out=None,keepdims=None)[source]#
Return the index of the minimum value of an array.
JAX implementation of
numpy.argmin().- Parameters:
- Returns:
an array containing the index of the minimum value along the specified axis.
- Return type:
Note
When the minimum value occurs more than once along a particular axis, thesmallest index is returned.
See also
jax.numpy.argmax(): return the index of the maximum value.jax.numpy.nanargmin(): computeargminwhile ignoring NaN values.
Examples
>>>x=jnp.array([1,3,5,4,2])>>>jnp.argmin(x)Array(0, dtype=int32)
>>>x=jnp.array([[1,3,2],...[5,4,1]])>>>jnp.argmin(x,axis=1)Array([0, 2], dtype=int32)
>>>jnp.argmin(x,axis=1,keepdims=True)Array([[0], [2]], dtype=int32)
Contents
