gluonts.mx.representation.custom_binning module#

class gluonts.mx.representation.custom_binning.CustomBinning(bin_centers: numpy.ndarray, *args, **kwargs)[source]#

Bases: gluonts.mx.representation.representation.Representation

A class representing binned representations with custom centers.

Parameters

bin_centers – The bins to be used to discretize the data. (default: 1024)

hybrid_forward(F, data: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], observed_indicator: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], scale: Optional[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]], rep_params: List[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]], **kwargs) Tuple[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], List[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]]][source]#

Transform the data into the desired representation.

Parameters
  • F

  • data – Target data.

  • observed_indicator – Target observed indicator.

  • scale – Pre-computed scale.

  • rep_params – Additional pre-computed representation parameters.

  • **kwargs – Additional block-specfic parameters.

:param : Additional block-specfic parameters.

Returns

Tuple consisting of the transformed data, the computed scale, and additional parameters to be passed to post_transform.

Return type

Tuple[Tensor, Tensor, List[Tensor]]

initialize_from_array(input_array: numpy.ndarray, ctx: mxnet.context.Context = cpu(0))[source]#

Initialize the representation based on a numpy array.

Parameters
  • input_array – Numpy array.

  • ctx – MXNet context.

initialize_from_dataset(input_dataset: gluonts.dataset.Dataset, ctx: mxnet.context.Context = cpu(0))[source]#

Initialize the representation based on an entire dataset.

Parameters
  • input_dataset – GluonTS dataset.

  • ctx – MXNet context.

post_transform(F, samples: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], scale: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], rep_params: List[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#

Transform samples back to the original representation.

Parameters
  • samples – Samples from a distribution.

  • scale – The scale of the samples.

  • rep_params – Additional representation-specific parameters used during post transformation.

Returns

Post-transformed samples.

Return type

Tensor