Mish

Contents

Mish#

class brainstate.nn.Mish(name=None)#

Applies the Mish function, element-wise.

Mish: A Self Regularized Non-Monotonic Neural Activation Function.

\[\text{Mish}(x) = x * \text{Tanh}(\text{Softplus}(x))\]

Notes

See Mish: A Self Regularized Non-Monotonic Neural Activation Function

Shape#

  • Input: \((*)\), where \(*\) means any number of dimensions.

  • Output: \((*)\), same shape as the input.

Examples

>>> import brainstate.nn as nn
>>> import brainstate
>>> m = nn.Mish()
>>> x = brainstate.random.randn(2)
>>> output = m(x)