2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

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

mindspore.nn.ELU

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

    指数线性单元激活函数(Exponential Linear Unit activation function)。

    对输入的每个元素计算ELU。该激活函数定义如下:

    .. math::
            E_{i} =
            \begin{cases}
            x_i, &\text{if } x_i \geq 0; \cr
            \alpha * (\exp(x_i) - 1), &\text{otherwise.}
            \end{cases}

    其中,:math:`x_i` 表示输入的元素,:math:`\alpha` 表示 `alpha` 参数。

    ELU函数图:

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

    参数:
        - **alpha** (`float`) - ELU的alpha值,数据类型为浮点数。默认值: ``1.0`` 。

    输入:
        - **x** (Tensor) - 用于计算ELU的任意维度的Tensor,数据类型为float16,float32。

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

    异常:
        - **TypeError** - `alpha` 不是浮点数。
        - **TypeError** - `x` 的数据类型既不是float16,也不是float32。
        - **ValueError** - `alpha` 不等于1.0。
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3

搜索帮助