gluonts.mx.distribution.bijection module

class gluonts.mx.distribution.bijection.AffineTransformation(loc: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol, None] = None, scale: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol, None] = None)[source]

Bases: gluonts.mx.distribution.bijection.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
f(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Forward transformation x -> y

f_inv(y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Inverse transformation y -> x

log_abs_det_jac(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Receives (x, y) and returns log of the absolute value of the Jacobian determinant

\[\log |dy/dx|\]

Note that this is the Jacobian determinant of the forward transformation x -> y.

property sign

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
f(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Forward transformation x -> y

f_inv(y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Inverse transformation y -> x

inverse_bijection() → gluonts.mx.distribution.bijection.Bijection[source]

Returns a Bijection instance that represents the inverse of this transformation.

log_abs_det_jac(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Receives (x, y) and returns log of the absolute value of the Jacobian determinant

\[\log |dy/dx|\]

Note that this is the Jacobian determinant of the forward transformation x -> y.

property sign

Return the sign of the Jacobian’s determinant.

class gluonts.mx.distribution.bijection.BijectionHybridBlock(prefix=None, params=None)[source]

Bases: mxnet.gluon.block.HybridBlock, gluonts.mx.distribution.bijection.Bijection

Allows a Bijection to have parameters

class gluonts.mx.distribution.bijection.ComposedBijection(bijections: Optional[List[gluonts.mx.distribution.bijection.Bijection]] = None)[source]

Bases: gluonts.mx.distribution.bijection.Bijection

Encapsulates a series of bijections and implements functions associated to their composition.

property event_dim
property event_shape
f(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.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[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.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[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.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[gluonts.mx.distribution.bijection.Bijection]] = None, *args, **kwargs)[source]

Bases: gluonts.mx.distribution.bijection.BijectionHybridBlock, gluonts.mx.distribution.bijection.ComposedBijection

Allows a ComposedBijection object to have parameters

class gluonts.mx.distribution.bijection.InverseBijection(bijection: gluonts.mx.distribution.bijection.Bijection)[source]

Bases: gluonts.mx.distribution.bijection.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
f(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Forward transformation x -> y

f_inv(y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Inverse transformation y -> x

inverse_bijection() → gluonts.mx.distribution.bijection.Bijection[source]

Returns a Bijection instance that represents the inverse of this transformation.

log_abs_det_jac(x: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], y: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]

Receives (x, y) and returns log of the absolute value of the Jacobian determinant

\[\log |dy/dx|\]

Note that this is the Jacobian determinant of the forward transformation x -> y.

property sign

Return the sign of the Jacobian’s determinant.