2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mindspore.nn.CELU.rst 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
宦晓玲 提交于 2023-12-05 10:50 . add image links in files 2.3

mindspore.nn.CELU

.. py:class:: mindspore.nn.CELU(alpha=1.0)

    CELU激活层(CELU Activation Operator)。

    根据Continuously Differentiable Exponential Linear Units对输入Tensor逐元素计算。

    .. math::
        \text{CELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))

    更多详情,请查看: `CELU <https://arxiv.org/abs/1704.07483>`_ 。

    CELU函数图:

    .. image:: ../images/CELU.png
        :align: center

    参数:
        - **alpha** (float) - CELU公式中的 :math:`\alpha` 值。默认值: ``1.0`` 。

    输入:
        - **x** (Tensor) - CELU的输入。其数据类型为float16或float32,shape为 :math:`(N,*)` ,其中 :math:`*` 表示任何数量的附加维度。

    输出:
        Tensor,数据类型和shape与 `x` 相同。

    异常:
        - **TypeError** - 如果 `α` 不是float。
        - **ValueError** - 如果 `α` 的值为0。
        - **TypeError** - 如果输入 `x` 不是Tensor。
        - **TypeError** - 如果输入 `x` 的数据类型既不是float16也不是float32。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3

搜索帮助