class Dict[str, int], domain_map: Callable[..., Tuple[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]]], dtype: gluonts.core.component.DType = <class 'numpy.float32'>, prefix: Optional[str] = None, **kwargs)[source]

Bases: mxnet.gluon.block.HybridBlock

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

  • 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[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) → Tuple[Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]][source]

Overrides to construct symbolic graph for this Block.

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

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



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

distr_cls: type = None
distribution(distr_args, 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]

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

  • 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[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.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

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

property event_shape

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

property value_in_support

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.


Bases: object

Class to connect a network to some output

args_dim: Dict[str, int] = None
domain_map(F, *args: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol])[source]
property dtype
get_args_proj(prefix: Optional[str] = None) →[source]