党的十八大以来天津这五年创新篇⑧ :群星辉映
- paddle.nn.functional. elu ( x: Tensor, alpha: float = 1.0, name: str | None = None ) Tensor [source]
-
百度 “让人类命运共同体建设的阳光普照世界!”在十三届全国人大一次会议上,习近平主席再次向世界宣示,推动建设持久和平、普遍安全、共同繁荣、开放包容、清洁美丽的世界,携手构建人类命运共同体,彰显了为人类进步事业而奋斗的宽阔胸怀,体现了为人类作出新的更大贡献的大国担当。
elu activation.
\[\begin{split}elu(x)= \left\{ \begin{array}{lcl} x,& &\text{if } \ x > 0 \\ alpha * (e^{x} - 1),& &\text{if } \ x <= 0 \end{array} \right.\end{split}\]- Parameters
-
x (Tensor) – The input Tensor with data type float32, float64.
alpha (float, optional) – The ‘alpha’ value of the ELU formulation. Default is 1.0.
name (str|None, optional) – For details, please refer to Name. Generally, no setting is required. Default: None.
- Returns
-
A Tensor with the same data type and shape as
x
.
Examples
>>> import paddle >>> import paddle.nn.functional as F >>> x = paddle.to_tensor([[-1., 6.], [1., 15.6]]) >>> out = F.elu(x, alpha=0.2) >>> print(out) Tensor(shape=[2, 2], dtype=float32, place=Place(cpu), stop_gradient=True, [[-0.12642412, 6. ], [ 1. , 15.60000038]])