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

22 lines
754 B
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.celu
========================
.. py:function:: mindspore.ops.celu(x, alpha=1.0)
celu激活函数按输入元素计算输出公式定义如下
.. math::
\text{CeLU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))
参数:
- **x** (Tensor) - celu的输入数据类型为float16或float32。
- **alpha** (float) - celu公式定义的阈值 :math:`\alpha` 。默认值1.0。
返回:
Tensorshape和数据类型与输入相同。
异常:
- **TypeError** - `alpha` 不是float。
- **ValueError** - `alpha` 的值为零。
- **TypeError** - `x` 不是tensor。
- **TypeError** - `x` 的dtype既不是float16也不是float32。