gluonts.torch.distributions.negative_binomial module#
- class gluonts.torch.distributions.negative_binomial.NegativeBinomial(total_count: Union[float, Tensor], probs: Optional[Union[float, Tensor]] = None, logits: Optional[Union[float, Tensor]] = None, validate_args=None)[source]#
Bases:
NegativeBinomial
Negative binomial distribution with total_count and probs or logits parameters.
Based on torch.distributions.NegativeBinomial, with added cdf and icdf methods.
- cdf(value: Tensor) Tensor [source]#
Returns the cumulative density/mass function evaluated at value.
- Parameters:
value (Tensor) –
- icdf(value: Tensor) Tensor [source]#
Returns the inverse cumulative density/mass function evaluated at value.
- Parameters:
value (Tensor) –
- property scipy_nbinom#
- class gluonts.torch.distributions.negative_binomial.NegativeBinomialOutput(beta: float = 0.0)[source]#
Bases:
DistributionOutput
- args_dim: Dict[str, int] = {'logits': 1, 'total_count': 1}#
- distr_cls#
alias of
NegativeBinomial
- distribution(distr_args, loc: Optional[Tensor] = None, scale: Optional[Tensor] = 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.
- classmethod domain_map(total_count: Tensor, logits: 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.
- in_features: int#