gluonts.mx.distribution.distribution_output module#

class gluonts.mx.distribution.distribution_output.ArgProj(args_dim: ~typing.Dict[str, int], domain_map: ~typing.Callable[[...], ~typing.Tuple[~typing.Union[~mxnet.ndarray.ndarray.NDArray, ~mxnet.symbol.symbol.Symbol]]], dtype: ~typing.Type = <class 'numpy.float32'>, prefix: ~typing.Optional[str] = None, **kwargs)[source]#

Bases: HybridBlock

A block that can be used to project from a dense layer to distribution arguments.

Parameters:
  • dim_args – Dictionary with string key and int value dimension of each arguments that will be passed to the domain map, the names are used as parameters prefix.

  • domain_map – Function returning a tuple containing one tensor a function or a HybridBlock. This will be called with num_args arguments and should return a tuple of outputs that will be used when calling the distribution constructor.

hybrid_forward(F, x: Union[NDArray, Symbol], **kwargs) Tuple[Union[NDArray, Symbol]][source]#

Overrides to construct symbolic graph for this Block.

Parameters:
  • x (Symbol or NDArray) – The first input tensor.

  • *args (list of Symbol or list of NDArray) – Additional input tensors.

class gluonts.mx.distribution.distribution_output.DistributionOutput[source]#

Bases: Output

Class to construct a distribution given the output of a network.

args_dim: Dict[str, int]#
distr_cls: type#
distribution(distr_args, loc: Optional[Union[NDArray, Symbol]] = None, scale: Optional[Union[NDArray, Symbol]] = None) Distribution[source]#

Construct the associated distribution, given the collection of constructor arguments and, optionally, a scale tensor.

Parameters:
  • distr_args – Constructor arguments for the underlying Distribution type.

  • loc – Optional tensor, of the same shape as the batch_shape+event_shape of the resulting distribution.

  • scale – Optional tensor, of the same shape as the batch_shape+event_shape of the resulting distribution.

domain_map(F, *args: Union[NDArray, Symbol])[source]#

Converts arguments to the right shape and domain.

The domain depends on the type of distribution, while the correct shape is obtained by reshaping the trailing axis in such a way that the returned tensors define a distribution of the right event_shape.

property event_dim: int#

Number of event dimensions, i.e., length of the event_shape tuple, of the distributions that this object constructs.

property event_shape: Tuple#

Shape of each individual event contemplated by the distributions that this object constructs.

property value_in_support: float#

A float that will have a valid numeric value when computing the log- loss of the corresponding distribution; by default 0.0.

This value will be used when padding data series.

class gluonts.mx.distribution.distribution_output.Output[source]#

Bases: object

Class to connect a network to some output.

args_dim: Dict[str, int]#
domain_map(F, *args: Union[NDArray, Symbol])[source]#
property dtype#
classmethod eps()[source]#
get_args_proj(prefix: Optional[str] = None) HybridBlock[source]#