bijx.Power¶
- class bijx.Power[source]¶
Bases:
ScalarBijection
Power transformation for positive values.
Applies a power transformation to positive inputs with a learnable exponent.
Type: \([0, \infty] \to [0, \infty]\)
Transform: \(x^p\) where \(p > 0\)
- Parameters:
exponent (
Union
[Variable
,Array
,ndarray
,Sequence
[Union
[int
,Any
]]]) – Exponent parameter specification, transformed to ensure positivity.transform_exponent (
Callable
|None
) – Function to ensure positive exponent (default: abs).rngs – Random number generators for parameter initialization.
Note
The constraint \(p > 0\) is not validated, but by default enforced by the
transform_exponent
function. Thus could also setexponent
to a constant negative value or integer (wrapped inConst
, to avoid training) after settingtransform_exponent=None
.Example
>>> bijection = Power(rngs=rngs) # Starts with p=1 >>> x = jnp.array([0.5, 1.0, 2.0]) >>> y, log_det = bijection.forward(x, jnp.zeros(3))
- __init__(exponent=(), transform_exponent=<PjitFunction of <function abs>>, *, rngs=None)[source]¶
- Parameters:
exponent (Variable | Array | ndarray | Sequence[int | Any])
transform_exponent (Callable | None)
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.