gluonts.torch.distributions.piecewise_linear module#
- class gluonts.torch.distributions.piecewise_linear.PiecewiseLinear(gamma: torch.Tensor, slopes: torch.Tensor, knot_spacings: torch.Tensor, validate_args=False)[source]#
Bases:
torch.distributions.distribution.Distribution
- property batch_shape: torch.Size#
Returns the shape over which parameters are batched.
- class gluonts.torch.distributions.piecewise_linear.PiecewiseLinearOutput(num_pieces: int)[source]#
Bases:
gluonts.torch.distributions.distribution_output.DistributionOutput
- distr_cls#
alias of
gluonts.torch.distributions.piecewise_linear.PiecewiseLinear
- distribution(distr_args, loc: Optional[torch.Tensor] = None, scale: Optional[torch.Tensor] = None) gluonts.torch.distributions.piecewise_linear.PiecewiseLinear [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.
- classmethod domain_map(gamma: torch.Tensor, slopes: torch.Tensor, knot_spacings: torch.Tensor) Tuple[torch.Tensor, torch.Tensor, torch.Tensor] [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_shape: Tuple#
Shape of each individual event compatible with the output object.
- class gluonts.torch.distributions.piecewise_linear.TransformedPiecewiseLinear(base_distribution: gluonts.torch.distributions.piecewise_linear.PiecewiseLinear, transforms: List[torch.distributions.transforms.AffineTransform], validate_args=None)[source]#
Bases:
torch.distributions.transformed_distribution.TransformedDistribution