gluonts.torch.distributions.negative_binomial 模块#
- class gluonts.torch.distributions.negative_binomial.NegativeBinomial(total_count: Union[float, torch.Tensor], probs: Optional[Union[float, torch.Tensor]] = None, logits: Optional[Union[float, torch.Tensor]] = None, validate_args=None)[source]#
基类:
torch.distributions.negative_binomial.NegativeBinomial
负二项分布,带有 total_count 和 probs 或 logits 参数。
基于 torch.distributions.NegativeBinomial,增加了 cdf 和 icdf 方法。
- property scipy_nbinom#
- class gluonts.torch.distributions.negative_binomial.NegativeBinomialOutput(beta: float = 0.0)[source]#
基类:
gluonts.torch.distributions.distribution_output.DistributionOutput
- args_dim: Dict[str, int] = {'logits': 1, 'total_count': 1}#
- distribution(distr_args, loc: Optional[torch.Tensor] = None, scale: Optional[torch.Tensor] = None) torch.distributions.distribution.Distribution [source]#
根据构造函数参数集合以及可选的比例张量,构造关联的分布。
- 参数
distr_args – 底层分布类型的构造函数参数。
loc – 可选张量,与结果分布的 batch_shape + event_shape 形状相同。
scale – 可选张量,与结果分布的 batch_shape + event_shape 形状相同。
- classmethod domain_map(total_count: torch.Tensor, logits: torch.Tensor)[source]#
将参数转换为正确的形状和域。
域取决于分布类型,而正确的形状是通过重塑尾部轴获得的,以便返回的张量定义具有正确 event_shape 的分布。
- property event_shape: Tuple#
与输出对象兼容的每个单独事件的形状。
- in_features: int#