mindspore.mint.nn.Mish
- class mindspore.mint.nn.Mish[源代码]
逐元素计算输入Tensor的MISH(A Self Regularized Non-Monotonic Neural Activation Function 自正则化非单调神经激活函数)。
更多参考详见
mindspore.mint.nn.functional.mish()
。Mish激活函数图:
- 支持平台:
Ascend
样例:
>>> import mindspore >>> from mindspore import Tensor, mint >>> import numpy as np >>> x = Tensor(np.array([[-1.1, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32) >>> mish = mint.nn.Mish() >>> output = mish(x) >>> print(output) [[-3.0764845e-01 3.9974124e+00 -2.6832507e-03] [ 1.9439589e+00 -3.3576239e-02 8.9999990e+00]]