Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions keras/activations.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ def softmax(x, axis=-1):
raise ValueError('Cannot apply softmax to a tensor that is 1D. '
'Received input: %s' % x)

def mish(x):
"""Mish: A Self Regularized Non-Monotonic Neural Activation Function (https://arxiv.org/abs/1908.08681v2)
Overperforms than both ReLU and Swish.
# Arguments
x: Input tensor.
# Returns
x * tanh(softplus(x))
"""
return x*K.tanh(K.softplus(x))

def elu(x, alpha=1.0):
"""Exponential linear unit.
Expand Down