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.logaddexp2.html below:

jax.numpy.logaddexp2 — JAX documentation

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

Logarithm of the sum of exponentials of inputs in base-2 avoiding overflow.

JAX implementation of numpy.logaddexp2.

Parameters:
  • x1 – input array or scalar.

  • x2 – input array or scalar. x1 and x2 should either have same shape or be broadcast compatible.

  • args (ArrayLike)

  • out (None)

  • where (None)

Returns:

An array containing the result, \(log_2(2^{x1}+2^{x2})\), element-wise.

Return type:

Any

Examples

>>> x1 = jnp.array([[3, -1, 4],
...                 [8, 5, -2]])
>>> x2 = jnp.array([2, 3, -5])
>>> result1 = jnp.logaddexp2(x1, x2)
>>> result2 = jnp.log2(jnp.exp2(x1) + jnp.exp2(x2))
>>> jnp.allclose(result1, result2)
Array(True, dtype=bool)

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