gluonts.mx.representation.hybrid_representation module#

class gluonts.mx.representation.hybrid_representation.HybridRepresentation(representations: List, *args, **kwargs)[source]#

Bases: Representation

A class representing a hybrid approach of combining multiple representations into a single representation. Representations will be combined by concatenating them on dim=-1.

Parameters:

representations – A list of representations. Elements must be of type Representation.

hybrid_forward(F, data: Union[NDArray, Symbol], observed_indicator: Union[NDArray, Symbol], scale: Optional[Union[NDArray, Symbol]], rep_params: List[Union[NDArray, Symbol]], **kwargs) Tuple[Union[NDArray, Symbol], Union[NDArray, Symbol], List[Union[NDArray, 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: ndarray, ctx: 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: Dataset, ctx: Context = cpu(0))[source]#

Initialize the representation based on an entire dataset.

Parameters:
  • input_dataset – GluonTS dataset.

  • ctx – MXNet context.