mindspore.nn.Mish

class mindspore.nn.Mish[源代码]

逐元素计算输入Tensor的MISH(Self Regularized Non-Monotonic Neural Activation Function 自正则化非单调神经激活函数)。

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

Mish函数图:

../../_images/Mish.png
支持平台:

Ascend GPU CPU

样例:

>>> import mindspore
>>> from mindspore import Tensor, nn
>>> import numpy as np
>>> x = Tensor(np.array([[-1.0, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32)
>>> mish = nn.Mish()
>>> output = mish(x)
>>> print(output)
[[-3.03401530e-01 3.99741292e+00 -2.68321624e-03]
 [ 1.94395900e+00 -3.35762873e-02 9.00000000e+00]]