mindspore.nn.SeLU

class mindspore.nn.SeLU[源代码]

逐元素计算激活函数SeLU(Scaled exponential Linear Unit)。

SeLU函数图:

../../_images/SeLU.png

更多参考详见 mindspore.ops.selu()

支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> from mindspore import Tensor, nn
>>> import numpy as np
>>> input_x = Tensor(np.array([[-1.0, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32)
>>> selu = nn.SeLU()
>>> output = selu(input_x)
>>> print(output)
[[-1.1113307 4.202804 -1.7575096]
[ 2.101402 -1.7462534 9.456309 ]]