Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.minimum

Contents

jax.numpy.minimum#

jax.numpy.minimum=<jnp.ufunc'minimum'>#

Return element-wise minimum of the input arrays.

JAX implementation ofnumpy.minimum.

Parameters:
  • x – input array or scalar.

  • y – input array or scalar. Bothx andy should either have same shapeor be broadcast compatible.

  • args (ArrayLike)

  • out (None)

  • where (None)

Returns:

An array containing the element-wise minimum ofx andy.

Return type:

Any

Note

For each pair of elements,jnp.minimum returns:
  • smaller of the two if both elements are finite numbers.

  • nan if one element isnan.

See also

Examples

Inputs withx.shape==y.shape:

>>>x=jnp.array([2,3,5,1])>>>y=jnp.array([-3,6,-4,7])>>>jnp.minimum(x,y)Array([-3,  3, -4,  1], dtype=int32)

Inputs having broadcast compatibility:

>>>x1=jnp.array([[1,5,2],...[-3,4,7]])>>>y1=jnp.array([-2,3,6])>>>jnp.minimum(x1,y1)Array([[-2,  3,  2],       [-3,  3,  6]], dtype=int32)

Inputs withnan:

>>>nan=jnp.nan>>>x2=jnp.array([[2.5,nan,-2],...[nan,5,6],...[-4,3,7]])>>>y2=jnp.array([1,nan,5])>>>jnp.minimum(x2,y2)Array([[ 1., nan, -2.],       [nan, nan,  5.],       [-4., nan,  5.]], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp