Logarithm of the sum of exponentials of inputs in base-2 avoiding overflow.
JAX implementation of numpy.logaddexp2
.
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)
An array containing the result, \(log_2(2^{x1}+2^{x2})\), element-wise.
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