cupy.random.zipf#

cupy.random.zipf(a, size=None, dtype=<class 'int'>)[源代码]#

Zipf 分布。

返回从 Zipf 分布中抽取的样本数组。其概率质量函数定义为

\[f(x) = \frac{x^{-a}}{ \zeta (a)},\]

其中 \(\zeta\) 是 Riemann Zeta 函数。

参数:
  • a (float) – Zipf 分布的参数 \(a\)

  • size (inttuple of ints) – 数组的形状。如果为 None,则生成一个零维数组。

  • dtype – 数据类型说明符。只允许 numpy.int32numpy.int64 类型。

返回:

从 Zipf 分布中抽取的样本。

返回类型:

cupy.ndarray

另请参阅

numpy.random.zipf()