mindspore.mint.nn.SiLU ============================= .. image:: https://mindspore-website.obs.cn-north-4.myhuaweicloud.com/website-images/master/resource/_static/logo_source.svg :target: https://atomgit.com/mindspore/mindspore/blob/master/docs/api/api_python/mint/mindspore.mint.nn.SiLU.rst :alt: 查看源文件 .. 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。