Class Mish

All Implemented Interfaces:
Serializable, Function<Tensor,Tensor>, Layer

public class Mish extends ActivationFunction
Mish activation function.

Mish is a self-regularized non-monotonic activation function:

  mish(x) = x * tanh(softplus(x))
          = x * tanh(ln(1 + exp(x)))

Mish is used in many modern object detection models such as YOLOv4/v5.

See Also:
  • Constructor Details

    • Mish

      public Mish()
      Constructor.
    • Mish

      public Mish(boolean inplace)
      Constructor.
      Parameters:
      inplace - true if the operation executes in-place.
  • Method Details

    • forward

      public Tensor forward(Tensor input)
      Description copied from interface: Layer
      Forward propagation (or forward pass) through the layer.
      Parameters:
      input - the input tensor.
      Returns:
      the output tensor.