Mish

Contents

Mish#

class brainpy.dnn.Mish(inplace=False)[source]#

Applies the Mish function, element-wise. Mish: A Self Regularized Non-Monotonic Neural Activation Function.

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

inplace (bool) – can optionally do the operation in-place. Default: False

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

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

Examples:

>>> import brainpy as bp
>>> import brainpy.math as bm
>>> m = bp.dnn.Mish()
>>> input = bm.random.randn(2)
>>> output = m(input)
update(input)[source]#

The function to specify the updating rule.

Return type:

TypeVar(ArrayType, Array, Variable, TrainVar, Array, ndarray)