jax.random.normal#

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

採樣具有給定形狀和浮點 dtype 的標準常態隨機值。

這些值根據以下機率密度函數回傳

\[f(x) = \frac{1}{\sqrt{2\pi}}e^{-x^2/2}\]

在定義域 \(-\infty < x < \infty\)

參數:
  • key (ArrayLike) – 用作隨機金鑰的 PRNG 金鑰。

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

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

傳回:

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

傳回型別:

Array