mish activation function use case improved version of the relu activation function used in computer vision for more detailed information you can refer to the following link https en wikipedia orgwikirectifierneuralnetworksmish implements the mish activation function parameters vector np ndarray the input array for mish activation returns np ndarray the input array after applying the mish activation formula fx x tanhsoftplusx x tanhln1 ex examples mishvectornp array2 3 0 6 2 3 8 array 2 26211893 0 46613649 0 25250148 0 08405831 mishnp array9 2 0 3 0 45 4 56 array0 00092952 0 15113318 0 33152014 0 04745745 implements the mish activation function parameters vector np ndarray the input array for mish activation returns np ndarray the input array after applying the mish activation formula f x x tanh softplus x x tanh ln 1 e x examples mish vector np array 2 3 0 6 2 3 8 array 2 26211893 0 46613649 0 25250148 0 08405831 mish np array 9 2 0 3 0 45 4 56 array 0 00092952 0 15113318 0 33152014 0 04745745
import numpy as np
from softplus import softplus


def mish(vector: np.ndarray) -> np.ndarray:
    
    return vector * np.tanh(softplus(vector))


if __name__ == "__main__":
    import doctest

    doctest.testmod()