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

32 lines
1.0 KiB
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.ops.celu
========================
.. py:function:: mindspore.ops.celu(x, alpha=1.0)
celu激活函数逐元素计算输入Tensor的celuContinuously differentiable exponential linear units值。公式定义如下
.. math::
\text{CeLU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))
详情请参考: `celu <https://arxiv.org/abs/1704.07483>`_
.. warning::
这是一个实验性API后续可能修改或删除。
CELU函数图
.. image:: ../images/CELU.png
:align: center
参数:
- **x** (Tensor) - celu的输入数据类型为float16或float32。
- **alpha** (float可选) - celu公式定义的阈值 :math:`\alpha` 。默认 ``1.0``
返回:
Tensorshape和数据类型与输入相同。
异常:
- **TypeError** - `alpha` 不是float。
- **TypeError** - `x` 不是Tensor。
- **TypeError** - `x` 的dtype既不是float16也不是float32。
- **ValueError** - `alpha` 的值为0。