gluonts.mx.distribution.bijection module#
- class gluonts.mx.distribution.bijection.AffineTransformation(loc: Optional[Union[NDArray, Symbol]] = None, scale: Optional[Union[NDArray, Symbol]] = None)[source]#
Bases:
Bijection
An affine transformation consisting of a scaling and a translation.
If translation is specified loc, and the scaling by scale, then this transformation computes y = scale * x + loc, where all operations are element-wise.
- Parameters
loc – Translation parameter. If unspecified or None, this will be zero.
scale – Scaling parameter. If unspecified or None, this will be one.
- property event_dim: int#
- log_abs_det_jac(x: Union[NDArray, Symbol], y: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Receives (x, y) and returns log of the absolute value of the Jacobian determinant.
Note that this is the Jacobian determinant of the forward transformation x -> y.
- property sign: Union[float, NDArray, Symbol]#
Return the sign of the Jacobian’s determinant.
- class gluonts.mx.distribution.bijection.Bijection[source]#
Bases:
object
A bijective transformation.
This is defined through the forward transformation (computed by the f method) and the inverse transformation (f_inv).
- property event_dim: int#
- inverse_bijection() Bijection [source]#
Returns a Bijection instance that represents the inverse of this transformation.
- log_abs_det_jac(x: Union[NDArray, Symbol], y: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Receives (x, y) and returns log of the absolute value of the Jacobian determinant.
Note that this is the Jacobian determinant of the forward transformation x -> y.
- property sign: Union[float, NDArray, Symbol]#
Return the sign of the Jacobian’s determinant.
- class gluonts.mx.distribution.bijection.BijectionHybridBlock(prefix=None, params=None)[source]#
Bases:
HybridBlock
,Bijection
Allows a Bijection to have parameters.
- class gluonts.mx.distribution.bijection.ComposedBijection(bijections: Optional[List[Bijection]] = None)[source]#
Bases:
Bijection
Encapsulates a series of bijections and implements functions associated to their composition.
- property event_dim#
- property event_shape#
- f(x: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Computes the forward transform of the composition of bijections.
- Parameters
x – Input Tensor for the forward transform.
- Returns
Transformation of x by the forward composition of bijections
- Return type
Tensor
- f_inv(y: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Computes the inverse transform of a composition of bijections.
- Parameters
y – Input Tensor for the inverse function
- Returns
Transformation of y by the inverse composition of bijections
- Return type
Tensor
- log_abs_det_jac(x: Union[NDArray, Symbol], y: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Logarithm of the absolute value of the Jacobian determinant corresponding to the composed bijection.
- Parameters
x – input of the forward transformation or output of the inverse transform
y – output of the forward transform or input of the inverse transform
- Returns
Jacobian evaluated for x as input or y as output
- Return type
Tensor
- class gluonts.mx.distribution.bijection.ComposedBijectionHybridBlock(bij_blocks: Optional[List[Bijection]] = None, *args, **kwargs)[source]#
Bases:
BijectionHybridBlock
,ComposedBijection
Allows a ComposedBijection object to have parameters.
- class gluonts.mx.distribution.bijection.InverseBijection(bijection: Bijection)[source]#
Bases:
Bijection
The inverse of a given transformation.
This is a wrapper around bijective transformations, that inverts the role of f and f_inv, and modifies other related methods accordingly.
- Parameters
bijection – The transformation to invert.
- property event_dim: int#
- inverse_bijection() Bijection [source]#
Returns a Bijection instance that represents the inverse of this transformation.
- log_abs_det_jac(x: Union[NDArray, Symbol], y: Union[NDArray, Symbol]) Union[NDArray, Symbol] [source]#
Receives (x, y) and returns log of the absolute value of the Jacobian determinant.
Note that this is the Jacobian determinant of the forward transformation x -> y.
- property sign: Union[float, NDArray, Symbol]#
Return the sign of the Jacobian’s determinant.