mindspore/docs/api/api_python/mint/mindspore.mint.nn.SiLU.rst

36 lines
798 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.mint.nn.SiLU
=============================
.. py:class:: mindspore.mint.nn.SiLU(inplace=False)
逐元素计算SiLU激活函数。有时也被称作Swish函数。
SiLU函数定义为
.. math::
\text{SiLU}(x) = x * \sigma(x),
其中 :math:`x_i` 是输入的元素, :math:`\sigma(x)` 是Sigmoid函数。
.. math::
\text{sigmoid}(x_i) = \frac{1}{1 + \exp(-x_i)},
SiLU函数图
.. image:: ../images/SiLU.png
:align: center
.. warning::
这是一个实验性API后续可能修改或删除。
参数:
- **inplace** (bool, 可选) - 若为 ``True`` 则启用原地更新功能。默认 ``False``
输入:
- **input** (Tensor) - 输入tensor。
输出:
Tensor。