當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python PyTorch Weibull用法及代碼示例

本文簡要介紹python語言中 torch.distributions.weibull.Weibull 的用法。

用法:

class torch.distributions.weibull.Weibull(scale, concentration, validate_args=None)

參數

  • scale(float或者Tensor) -分布的尺度參數 (lambda)。

  • concentration(float或者Tensor) -分布的濃度參數(k/shape)。

基礎:torch.distributions.transformed_distribution.TransformedDistribution

來自two-parameter Weibull 分布的樣本。

示例

>>> m = Weibull(torch.tensor([1.0]), torch.tensor([1.0]))
>>> m.sample()  # sample from a Weibull distribution with scale=1, concentration=1
tensor([ 0.4784])

相關用法


注:本文由純淨天空篩選整理自pytorch.org大神的英文原創作品 torch.distributions.weibull.Weibull。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。