mindspore/docs/api/api_python/nn/mindspore.nn.CELU.rst

31 lines
1.1 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.nn.CELU
==================
.. py:class:: mindspore.nn.CELU(alpha=1.0)
CELU激活层CELU Activation Operator
根据Continuously Differentiable Exponential Linear Units对输入Tensor逐元素计算。
.. math::
\text{CELU}(x) = \max(0,x) + \min(0, \alpha * (\exp(x/\alpha) - 1))
其返回值为 :math:`\max(0,x)+\min(0,\Alpha*(\exp(x/\Alpha)-1))`
更多详情,请查看: `CELU <https://arxiv.org/abs/1704.07483>`_
参数:
- **alpha** (float) - CELU公式中的 :math:`\alpha` 值。默认值1.0。
输入:
- **x** (Tensor) - CELU的输入。其数据类型为float16或float32shape为 :math:`(N,*)` ,其中 :math:`*` 表示任何数量的附加维度。
输出:
Tensor数据类型和shape与 `x` 相同。
异常:
- **TypeError** - 如果 `α` 不是float。
- **ValueError** - 如果 `α` 的值为0。
- **TypeError** - 如果 输入 `x` 不是Tensor。
- **TypeError** - 如果输入 `x` 的数据类型既不是float16也不是float32。