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

24 lines
895 B
ReStructuredText
Raw Permalink Normal View History

mindspore.ops.celu
========================
.. py:function:: mindspore.ops.celu(x, alpha=1.0)
2022-10-29 17:50:20 +08:00
celu激活函数逐元素计算输入Tensor的celuContinuously differentiable exponential linear units值。公式定义如下
.. math::
\text{CeLU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))
2022-10-29 17:50:20 +08:00
详情请参考: `celu <https://arxiv.org/abs/1704.07483>`_
2022-07-25 15:09:45 +08:00
参数:
- **x** (Tensor) - celu的输入数据类型为float16或float32。
- **alpha** (float) - celu公式定义的阈值 :math:`\alpha` 。默认值1.0。
返回:
Tensorshape和数据类型与输入相同。
异常:
- **TypeError** - `alpha` 不是float。
2022-10-29 17:50:20 +08:00
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `x` 的dtype既不是float16也不是float32。
- **ValueError** - `alpha` 的值为0。