bijx.SoftPlus¶
- class bijx.SoftPlus[source]¶
Bases:
ScalarBijection
SoftPlus transform.
Maps the real line to positive reals using the softplus function.
Type: \([-\infty, \infty] \to [0, \infty]\)
Transform: \(\text{softplus}(x) = \log(1 + e^x)\)
Example
>>> bijection = SoftPlus() >>> x = jnp.array([-5.0, 0.0, 5.0]) >>> y, log_det = bijection.forward(x, jnp.zeros(3))
- __init__(*args, **kwargs)¶
Methods
forward
(x, log_density, **kwargs)Apply forward transformation with log-density update.
fwd
(x, **kwargs)Apply forward transformation.
invert
()Create an inverted version of this bijection.
log_jac
(x, y, **kwargs)Compute log absolute determinant of the Jacobian.
rev
(y, **kwargs)Apply reverse (inverse) transformation.
reverse
(y, log_density, **kwargs)Apply reverse transformation with log-density update.
- log_jac(x, y, **kwargs)[source]¶
Compute log absolute determinant of the Jacobian.
- Parameters:
x – Input values where Jacobian is computed.
y – Output values corresponding to x (i.e., y = fwd(x)).
**kwargs – Additional transformation-specific arguments.
- Returns:
Log absolute Jacobian determinant \(\log \abs{f'(x)}\) with same shape as x.