Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 28 additions & 4 deletions docs/api/paddle/distribution/Normal_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,22 @@ Normal

正态分布

数学公式
若 `loc` 是实数,概率密度函数为

.. math::

pdf(x; \mu, \sigma) = \frac{1}{Z}e^{\frac {-0.5 (x - \mu)^2} {\sigma^2} }

Z = (2 \pi \sigma^2)^{0.5}

若 `loc` 是复数,概率密度函数为:

.. math::

pdf(x; \mu, \sigma) = \frac{1}{Z}e^{\frac {-(x - \mu)^2} {\sigma^2} }

Z = \pi \sigma^2

上面的数学公式中:

- :math:`loc = \mu`:平均值;
Expand All @@ -25,7 +33,7 @@ Normal
参数
::::::::::::

- **loc** (int|float|list|tuple|numpy.ndarray|Tensor) - 正态分布平均值。数据类型为 float32 或 float64
- **loc** (int|float|complex|list|tuple|numpy.ndarray|Tensor) - 正态分布平均值。数据类型为 float32、float64、complex64complex128
- **scale** (int|float|list|tuple|numpy.ndarray|Tensor) - 正态分布标准差。数据类型为 float32 或 float64。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

Expand Down Expand Up @@ -85,12 +93,18 @@ entropy()

信息熵

数学公式
实高斯分布信息熵的数学公式

.. math::

entropy(\sigma) = 0.5 \log (2 \pi e \sigma^2)

复高斯分布信息熵的数学公式:

.. math::

entropy(\sigma) = \log (\pi e \sigma^2) + 1

上面的数学公式中:

:math:`scale = \sigma`:标准差。
Expand Down Expand Up @@ -130,7 +144,7 @@ kl_divergence(other)

两个正态分布之间的 KL 散度。

数学公式
实高斯分布 KL 散度的数学公式

.. math::

Expand All @@ -140,6 +154,16 @@ kl_divergence(other)

diff = \mu_1 - \mu_0

复高斯分布 KL 散度的数学公式:

.. math::

KL\_divergence(\mu_0, \sigma_0; \mu_1, \sigma_1) = ratio^2 + (\frac{diff}{\sigma_1})^2 - 1 - 2 \ln {ratio}

ratio = \frac{\sigma_0}{\sigma_1}

diff = \mu_1 - \mu_0

上面的数学公式中:

- :math:`loc = \mu_0`:当前正态分布的平均值;
Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/nn/initializer/Normal_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Normal
参数
::::::::::::

- **mean** (float,可选) - 正态分布的平均值。默认值为 0。
- **mean** (float|complex,可选) - 正态分布的平均值。默认值为 0。
- **std** (float,可选) - 正态分布的标准差。默认值为 1.0。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/randn_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ randn
参数
::::::::::
- **shape** (list|tuple|Tensor) - 生成的随机 Tensor 的形状。如果 ``shape`` 是 list、tuple,则其中的元素可以是 int,或者是形状为[]且数据类型为 int32、int64 的 0-D Tensor。如果 ``shape`` 是 Tensor,则是数据类型为 int32、int64 的 1-D Tensor。
- **dtype** (str|np.dtype,可选) - 输出 Tensor 的数据类型,支持 float32、float64。当该参数值为 None 时,输出 Tensor 的数据类型为 float32。默认值为 None。
- **dtype** (str|np.dtype,可选) - 输出 Tensor 的数据类型,支持 float32、float64、complex64、complex128。当该参数值为 None 时,输出 Tensor 的数据类型为 float32。默认值为 None。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
Expand Down
2 changes: 1 addition & 1 deletion docs/api/paddle/standard_normal_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ standard_normal
参数
::::::::::
- **shape** (list|tuple|Tensor) - 生成的随机 Tensor 的形状。如果 ``shape`` 是 list、tuple,则其中的元素可以是 int,或者是形状为[]且数据类型为 int32、int64 的 0-D Tensor。如果 ``shape`` 是 Tensor,则是数据类型为 int32、int64 的 1-D Tensor。
- **dtype** (str|np.dtype,可选) - 输出 Tensor 的数据类型,支持 float32、float64。当该参数值为 None 时,输出 Tensor 的数据类型为 float32。默认值为 None。
- **dtype** (str|np.dtype,可选) - 输出 Tensor 的数据类型,支持 float32、float64、complex64、complex128。当该参数值为 None 时,输出 Tensor 的数据类型为 float32。默认值为 None。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。

返回
Expand Down