Skip to content

Commit

Permalink
gelu doc update (PaddlePaddle#1904)
Browse files Browse the repository at this point in the history
* add update for gelu: approximation option
  • Loading branch information
Feiyu Chan authored Mar 17, 2020
1 parent c1cd6a6 commit 8c47276
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/fluid/api_cn/layers_cn/gelu_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,19 @@ gelu
逐元素计算 Gelu激活函数。更多细节请参考 `Gaussian Error Linear Units <https://arxiv.org/abs/1606.08415>`_ 。

如果使用近似计算:

.. math::
out = 0.5 * x * (1 + tanh(\sqrt{\frac{2}{\pi}} * (x + 0.044715x^{3})))
如果不使用近似计算:

.. math::
out = 0.5 * x * (1 + erf(\frac{x}{\sqrt{2}}))
参数:
- **x** (Variable) - Gelu Op 的输入,多维 Tensor 或 LoDTensor,数据类型为 float32 或 float64。
- **approximate** (bool, 可选) - 是否使用近似计算,默认值为 False。

返回:
- 多维 Tensor 或 LoDTensor, 数据类型为 float32 或 float64, 和输入 x 的数据类型相同,形状和输入 x 相同。
Expand Down

0 comments on commit 8c47276

Please sign in to comment.