maxframe.tensor.random.exponential#
- maxframe.tensor.random.exponential(scale=1.0, size=None, chunk_size=None, gpu=None, dtype=None)[源代码]#
从指数分布中抽取样本。
其概率密度函数为
\[f(x; \frac{1}{\beta}) = \frac{1}{\beta} \exp(-\frac{x}{\beta}),\]对于
x > 0为上述公式,其余地方为 0。\(\beta\) 是尺度参数,即速率参数 \(\lambda = 1/\beta\) 的倒数。速率参数是指数分布的一种替代且广泛使用的参数化方式 [3]。指数分布是几何分布的连续类比。它描述了许多常见情况,例如多次暴雨中测量的雨滴大小 [1],或 Wikipedia 页面请求之间的时间间隔 [2]。
- 参数:
scale (float or array_like of floats) -- 尺度参数,\(\beta = 1/\lambda\)。
size (int or tuple of ints, optional) -- 输出形状。如果给定形状为,例如
(m, n, k),则抽取m * n * k个样本。如果 size 为None``(默认),当 ``scale为标量时返回单个值。否则,抽取np.array(scale).size个样本。chunk_size (int or tuple of int or tuple of ints, optional) -- 每个维度上期望的块大小
gpu (bool, optional) -- 如果为 True 则在 GPU 上分配张量,默认为 False
dtype (data-type, optional) -- 返回张量的数据类型。
- 返回:
out -- 从参数化的指数分布中抽取的样本。
- 返回类型:
Tensor or scalar
引用