mindspore/docs/api/api_python/ops/mindspore.ops.func_rrelu.rst

32 lines
1.2 KiB
ReStructuredText
Raw 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.ops.rrelu
===================
.. py:function:: mindspore.ops.rrelu(x, lower=1 / 8, upper=1 / 3)
Randomized Leaky ReLU激活函数。
该激活函数定义如下:
.. math::
\text{rrelu}(x_{ji}) = \begin{cases}x_{ji}, &\text{if } x_{ji} \geq 0; \cr
{\alpha_{ji}} * x_{ji}, &\text{otherwise.}\end{cases}
其中,:math:`\alpha_{ji}` ~ :math:`U(l, u)`, :math:`l \le u`.
更多细节详见 `Empirical Evaluation of Rectified Activations in Convolution Network <https://arxiv.org/pdf/1505.00853.pdf>`_
参数:
- **x** (Tensor) - 计算RReLU的任意维度的Tensor。
- **lower** (Union[int, float]) - x<0时激活函数的斜率的下界默认值1/8。
- **upper** (Union[int, float]) - x<0时激活函数的斜率的上界默认值1/3。
返回:
Tensor数据类型和shape与 `x` 相同。
异常:
- **TypeError** - `lower` 不是浮点数或整数。
- **TypeError** - `upper` 不是浮点数或整数。
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `x` 内的数据类型不是mindspore.float16或mindspore.float32。
- **ValueError** - `lower` 大于 `upper`