bijx.Sinh

class bijx.Sinh[source]

Bases: ScalarBijection

Hyperbolic sine transformation.

Maps the real line to itself using the hyperbolic sine function. This provides a smooth, odd function that grows exponentially for large \(\abs{x}\) while remaining approximately linear near zero. Becomes numerically unstable for large \(\abs{x}\).

Type: \([-\infty, \infty] \to [-\infty, \infty]\)

Transform: \(\sinh(x) = \frac{e^x - e^{-x}}{2}\)

Example

>>> bijection = Sinh()
>>> x = jnp.array([-1.0, 0.0, 1.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.

fwd(x, **kwargs)[source]

Apply forward transformation.

Parameters:
  • x – Input values to transform.

  • **kwargs – Additional transformation-specific arguments.

Returns:

Transformed values \(y = f(x)\) with same shape as \(x\).

rev(y, **kwargs)[source]

Apply reverse (inverse) transformation.

Parameters:
  • y – Output values to inverse-transform.

  • **kwargs – Additional transformation-specific arguments.

Returns:

Inverse-transformed values \(x = f^{-1}(y)\) with same shape as \(y\).