jax.random.laplace#

jax.random.laplace(key, shape=(), dtype=<class 'float'>)[source]#

採樣具有給定形狀和浮點 dtype 的 Laplace 隨機值。

這些值根據機率密度函數分佈

\[f(x) = \frac{1}{2}e^{-|x|}\]
參數:
  • key (ArrayLike) – 用作隨機金鑰的 PRNG 金鑰。

  • shape (Shape) – 選項,表示結果形狀的非負整數元組。預設值為 ()。

  • dtype (DTypeLikeFloat) – 選項,用於傳回值的浮點 dtype(如果 jax_enable_x64 為 true,則預設為 float64,否則為 float32)。

傳回:

傳回具有指定形狀和 dtype 的隨機陣列。

傳回類型:

陣列