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_countprobslogits 参数。

基于 torch.distributions.NegativeBinomial,增加了 cdficdf 方法。

cdf(value: torch.Tensor) torch.Tensor[source]#

返回在 value 处计算的累积密度/质量函数。

参数

value (Tensor) –

icdf(value: torch.Tensor) torch.Tensor[source]#

返回在 value 处计算的逆累积密度/质量函数。

参数

value (Tensor) –

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}#
distr_cls#

别名:gluonts.torch.distributions.negative_binomial.NegativeBinomial

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#