gluonts.torch.distributions.piecewise_linear 模块#

class gluonts.torch.distributions.piecewise_linear.PiecewiseLinear(gamma: torch.Tensor, slopes: torch.Tensor, knot_spacings: torch.Tensor, validate_args=False)[source]#

基类: torch.distributions.distribution.Distribution

属性 batch_shape: torch.Size#

返回参数的批处理形状。

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

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

参数

value (Tensor)

crps(z: torch.Tensor) torch.Tensor[source]#
loss(z: torch.Tensor) torch.Tensor[source]#
静态方法 parametrize_knots(knot_spacings: torch.Tensor) torch.Tensor[source]#
静态方法 parametrize_slopes(slopes: torch.Tensor) torch.Tensor[source]#
quantile(u: torch.Tensor) torch.Tensor[source]#
quantile_internal(u: torch.Tensor, dim: Optional[int] = None) torch.Tensor[source]#
rsample(sample_shape: torch.Size = torch.Size([])) torch.Tensor[source]#

生成具有 sample_shape 的重参数化样本,或者如果分布参数是批量处理的,则生成 sample_shape 形状的重参数化样本批次。

class gluonts.torch.distributions.piecewise_linear.PiecewiseLinearOutput(num_pieces: int)[source]#

基类: gluonts.torch.distributions.distribution_output.DistributionOutput

distr_cls#

的别名 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]#

根据构造函数的参数集合以及可选的尺度张量,构造关联的分布。

参数
  • distr_args – 底层分布类型的构造函数参数。

  • loc – 可选张量,形状与结果分布的 batch_shape+event_shape 相同。

  • scale – 可选张量,形状与结果分布的 batch_shape+event_shape 相同。

类方法 domain_map(gamma: torch.Tensor, slopes: torch.Tensor, knot_spacings: torch.Tensor) Tuple[torch.Tensor, torch.Tensor, torch.Tensor][source]#

将参数转换为正确的形状和定义域。

定义域取决于分布的类型,而正确的形状是通过重塑尾部轴获得的,以便返回的张量定义了具有正确 event_shape 的分布。

属性 event_shape: Tuple#

与输出对象兼容的每个独立事件的形状。

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]#

基类: torch.distributions.transformed_distribution.TransformedDistribution

crps(y: torch.Tensor) torch.Tensor[source]#