mindspore.nn.Mish

View Source On Gitee
class mindspore.nn.Mish[source]

Computes MISH (A Self Regularized Non-Monotonic Neural Activation Function) of input tensors element-wise.

Refer to mindspore.ops.mish() for more details.

Mish Activation Function Graph:

../../_images/Mish.png
Supported Platforms:

Ascend GPU CPU

Examples

>>> 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]]