forked from PaddlePaddle/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
polish some docs (PaddlePaddle#2403)
* polish some docs * polish some docs * Update square_cn.rst * polish some docs * polish some docs * polish round docs * polish round docs * Update square_cn.rst
- Loading branch information
Showing
7 changed files
with
172 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
.. _cn_api_nn_functional_sigmoid: | ||
|
||
sigmoid | ||
------------------------------- | ||
|
||
.. py:function:: paddle.nn.functional.sigmoid(x, name=None) | ||
sigmoid激活函数 | ||
|
||
.. math:: | ||
out = \frac{1}{1 + e^{-x}} | ||
参数: | ||
- **x** (Tensor) - 输入的 `Tensor` ,数据类型为:float32、float64。 | ||
- **name** (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name` 。 | ||
|
||
返回: | ||
- Tensor,对输入x进行sigmoid激活后的Tensor,形状、数据类型与输入x一致。 | ||
|
||
|
||
**代码示例**: | ||
|
||
.. code-block:: python | ||
import numpy as np | ||
import paddle | ||
import paddle.nn.functional as F | ||
paddle.disable_static() | ||
x_data = np.array([-0.4, -0.2, 0.1, 0.3]) | ||
x = paddle.to_tensor(x_data) | ||
out = F.sigmoid(x) | ||
print(out.numpy()) | ||
# [0.40131234 0.450166 0.52497919 0.57444252] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
.. _cn_api_tensor_erf: | ||
|
||
erf | ||
------------------------------- | ||
**版本升级,文档正在开发中** | ||
|
||
.. py:function:: paddle.erf(x, name=None) | ||
逐元素计算 Erf 激活函数。更多细节请参考 `Error function <https://en.wikipedia.org/wiki/Error_function>`_ 。 | ||
|
||
|
||
.. math:: | ||
out = \frac{2}{\sqrt{\pi}} \int_{0}^{x}e^{- \eta^{2}}d\eta | ||
参数: | ||
- **x** (Tensor) - 输入的 `Tensor` ,数据类型为: float16, float32, float64。 | ||
- **name** (str,可选) - 操作的名称(可选,默认值为None)。更多信息请参见 :ref:`api_guide_Name` 。 | ||
|
||
返回: | ||
- Tensor,对输入x进行erf激活后的Tensor,形状、数据类型与输入 x 一致。 | ||
|
||
|
||
**代码示例**: | ||
|
||
.. code-block:: python | ||
import numpy as np | ||
import paddle | ||
paddle.disable_static() | ||
x_data = np.array([-0.4, -0.2, 0.1, 0.3]) | ||
x = paddle.to_tensor(x_data) | ||
out = paddle.erf(x) | ||
print(out.numpy()) | ||
# [-0.42839236 -0.22270259 0.11246292 0.32862676] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters