2.5K Star 8.4K Fork 4.7K

GVPMindSpore/mindspore

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

mindspore.nn.LeakyReLU

.. py:class:: mindspore.nn.LeakyReLU(alpha=0.2)

    逐元素计算Leaky ReLU激活函数。

    该激活函数定义如下:

    .. math::
        \text{leaky_relu}(x) = \begin{cases}x, &\text{if } x \geq 0; \cr
        {\alpha} * x, &\text{otherwise.}\end{cases}

    其中,:math:`\alpha` 表示 `alpha` 参数。

    更多细节详见 `Rectifier Nonlinearities Improve Neural Network Acoustic Models <https://ai.stanford.edu/~amaas/papers/relu_hybrid_icml2013_final.pdf>`_ 。

    LeakyReLU函数图:

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

    参数:
        - **alpha** (`Union[int, float]`) - `x` 小于0时激活函数的斜率,默认值: ``0.2`` 。

    输入:
        - **x** (Tensor) - 计算LeakyReLU的任意维度的Tensor。

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

    异常:
        - **TypeError** - `alpha` 不是浮点数或整数。
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore
r2.3.q1

搜索帮助