mindspore.ops.Mish¶
-
class
mindspore.ops.
Mish
(*args, **kwargs)[source]¶ Computes MISH(A Self Regularized Non-Monotonic Neural Activation Function) of input tensors element-wise.
The function is shown as follows:
\[\text{output} = x * \tan(\log(1 + \exp(\text{x})))\]See more details in A Self Regularized Non-Monotonic Neural Activation Function.
- Inputs:
x (Tensor) - The input tensor. Only support float16 and float32.
- Outputs:
Tensor, with the same type and shape as the x.
- Supported Platforms:
Ascend
- Raise:
TypeError: If dtype of x is neither float16 nor float32.
Examples
>>> input_x = Tensor(np.array([[-1.0, 4.0, -8.0], [2.0, -5.0, 9.0]]), mindspore.float32) >>> mish = ops.Mish() >>> output = mish(input_x) >>> print(output) [[-3.034014e-01 3.997413e+00 -2.682209e-03] [ 1.943959e+00 -3.357619e-02 8.999999e+00]]