sciai.architecture.Swish
- class sciai.architecture.Swish[source]
Swish(Silu) activation function with backward propagation.
- Inputs:
x (Tensor) - The input of Swish(Silu).
- Outputs:
Tensor, activated output with the same type and shape as x.
- Supported Platforms:
GPU
CPU
Ascend
Examples
>>> import mindspore as ms >>> from mindspore import ops >>> from sciai.architecture import Swish >>> swish = Swish() >>> x = ops.ones((2, 3), ms.float32) >>> y = swish(x) >>> print(y) [[0.73105854 0.73105854 0.73105854] [0.73105854 0.73105854 0.73105854]]