jax.random.gumbel#

jax.random.gumbel(key, shape=(), dtype=<class 'float'>)[原始碼]#

取樣具有給定形狀和浮點 dtype 的耿貝爾隨機值。

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

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

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

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

傳回:

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

傳回類型:

陣列