jax.random.poisson#

jax.random.poisson(key, lam, shape=None, dtype=<class 'int'>)[源代码]#

采样具有给定形状和整数 dtype 的泊松随机值。

这些值根据概率质量函数分布

\[f(k; \lambda) = \frac{\lambda^k e^{-\lambda}}{k!}\]

其中 k 是非负整数,\(\lambda > 0\)

参数:
  • key (ArrayLike) – 用作随机键的 PRNG 键。

  • lam (RealArray) – 速率参数(分布的均值),必须 >= 0。必须与 shape 广播兼容

  • shape (Shape | None | None) – 可选,表示结果形状的非负整数元组。默认值 (None) 生成的结果形状等于 lam.shape

  • dtype (DTypeLikeInt) – 可选,返回值的整数 dtype(如果 jax_enable_x64 为 true,则默认为 int64,否则为 int32)。

返回:

具有指定 dtype 的随机数组,其形状由 shape 给出(如果 shape 不是 None, 否则 ``lam.shape``)。

返回类型:

Array