mindspore2022/docs/api/api_python/nn/mindspore.nn.ReLU.rst

27 lines
822 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.nn.ReLU
=================
.. py:class:: mindspore.nn.ReLU
修正线性单元激活函数Rectified Linear Unit activation function
逐元素求 :math:`\max(x,\ 0)` 。特别说明负数输出值会被修改为0正数输出不受影响。
.. math::
\text{ReLU}(x) = (x)^+ = \max(0, x),
ReLU相关图参见 `ReLU <https://en.wikipedia.org/wiki/Activation_function#/media/File:Activation_rectified_linear.svg>`_
**输入:**
- **x** (Tensor) - 用于计算ReLU的任意维度的Tensor。数据类型为 `number <https://www.mindspore.cn/docs/api/zh-CN/master/api_python/mindspore.html#mindspore.dtype>`_
**输出:**
Tensor数据类型和shape与 `x` 相同。
**异常:**
- **TypeError** - `x` 的数据类型不是number。