Scalar Affine Bijector¤
distreqx.bijectors.scalar_affine.ScalarAffine (AbstractBijector)
¤
An affine bijector that acts elementwise.
The bijector is defined as follows:
- Forward:
y = scale * x + shift
- Forward Jacobian determinant:
log|det J(x)| = log|scale|
- Inverse:
x = (y - shift) / scale
- Inverse Jacobian determinant:
log|det J(y)| = -log|scale|
where scale
and shift
are the bijector's parameters.
__init__(self, shift: Array, scale: Optional[Array] = None, log_scale: Optional[Array] = None)
¤
Initializes a ScalarAffine bijector.
Arguments:
shift
: the bijector's shift parameter.scale
: the bijector's scale parameter. NOTE:scale
must be non-zero, otherwise the bijector is not invertible. It is the user's responsibility to make surescale
is non-zero; the class will make no attempt to verify this.log_scale
: the log of the scale parameter. If specified, the bijector's scale is set equal toexp(log_scale)
. Unlikescale
,log_scale
is an unconstrained parameter. NOTE: eitherscale
orlog_scale
can be specified, but not both. If neither is specified, the bijector's scale will default to 1.
Raises:
ValueError
: if bothscale
andlog_scale
are not None.