mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
Changed Mish Activation Function to use Softplus (#10111)
This commit is contained in:
parent
937ce83b15
commit
08d394126c
|
@ -7,6 +7,7 @@ https://en.wikipedia.org/wiki/Rectifier_(neural_networks)#Mish
|
|||
"""
|
||||
|
||||
import numpy as np
|
||||
from softplus import softplus
|
||||
|
||||
|
||||
def mish(vector: np.ndarray) -> np.ndarray:
|
||||
|
@ -30,7 +31,7 @@ def mish(vector: np.ndarray) -> np.ndarray:
|
|||
array([-0.00092952, -0.15113318, 0.33152014, -0.04745745])
|
||||
|
||||
"""
|
||||
return vector * np.tanh(np.log(1 + np.exp(vector)))
|
||||
return vector * np.tanh(softplus(vector))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in New Issue
Block a user