You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.nn.probability.distribution.Gumbel.rst 1.5 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. mindspore.nn.probability.distribution.Gumbel
  2. ================================================
  3. .. py:class:: mindspore.nn.probability.distribution.Gumbel(loc, scale, seed=0, dtype=mstype.float32, name='Gumbel')
  4. Gumbel分布(Gumbel distribution)。
  5. 连续随机分布,取值范围为 :math:`(0, \inf)` ,概率密度函数为
  6. .. math::
  7. f(x, a, b) = 1 / b \exp(\exp(-(x - a) / b) - x).
  8. 其中 :math:`a, b` 为分别为Gumbel分布的位置参数和比例参数。
  9. **参数:**
  10. - **loc** (int, float, list, numpy.ndarray, Tensor) - Gumbel分布的位置。
  11. - **scale** (int, float, list, numpy.ndarray, Tensor) - Gumbel分布的尺度。
  12. - **seed** (int) - 采样时使用的种子。如果为None,则使用全局种子。默认值:0。
  13. - **dtype** (mindspore.dtype) - 分布类型。默认值:mindspore.float32。
  14. - **name** (str) - 分布的名称。默认值:'Gumbel'。
  15. .. note::
  16. - `scale` 必须大于零。
  17. - `dtype` 必须是浮点类型,因为Gumbel分布是连续的。
  18. - GPU后端不支持 `kl_loss` 和 `cross_entropy` 。
  19. **异常:**
  20. - **ValueError** - `scale` 中元素小于0。
  21. - **TypeError** - `dtype` 不是float的子类。
  22. .. py:method:: loc
  23. :property:
  24. 返回分布位置。
  25. **返回:**
  26. Tensor, 分布的位置值。
  27. .. py:method:: scale
  28. :property:
  29. 返回分布比例。
  30. **返回:**
  31. Tensor, 分布的比例值。