bijx.Partial¶
- class bijx.Partial[source]¶
Bases:
Bijection
Bijection wrapper that fixes keyword arguments.
Creates a new bijection by partially applying keyword arguments to an existing bijection. This is useful for creating specialized versions of configurable bijections or for setting default parameters.
The wrapped bijection receives both the fixed kwargs and any additional kwargs passed at call time, with call-time kwargs taking precedence.
- __init__(bijection, **kwargs)[source]¶
Initialize partial bijection with fixed keyword arguments.
- Parameters:
bijection (
Bijection
) – The bijection to wrap.**kwargs – Keyword arguments to fix for all calls.
Methods
forward
(x, log_density, **kwargs)Apply forward transformation with fixed and additional kwargs.
invert
()Create an inverted version of this bijection.
reverse
(x, log_density, **kwargs)Apply reverse transformation with fixed and additional kwargs.
- forward(x, log_density, **kwargs)[source]¶
Apply forward transformation with fixed and additional kwargs.
- Parameters:
x – Input to transform.
log_density – Input log density.
**kwargs – Additional keyword arguments (override fixed ones).
- Returns:
Result from wrapped bijection’s forward method.
- reverse(x, log_density, **kwargs)[source]¶
Apply reverse transformation with fixed and additional kwargs.
- Parameters:
x – Input to inverse transform.
log_density – Input log density.
**kwargs – Additional keyword arguments (override fixed ones).
- Returns:
Result from wrapped bijection’s reverse method.