Merge pull request #1753 from digantamisra98/patch-1
Added Mish Activation Function
This commit is contained in:
@@ -138,7 +138,11 @@ def swish(x):
|
|||||||
return x * torch.sigmoid(x)
|
return x * torch.sigmoid(x)
|
||||||
|
|
||||||
|
|
||||||
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new}
|
def mish(x):
|
||||||
|
return x * torch.tanh(nn.functional.softplus(x))
|
||||||
|
|
||||||
|
|
||||||
|
ACT2FN = {"gelu": gelu, "relu": torch.nn.functional.relu, "swish": swish, "gelu_new": gelu_new, "mish": mish}
|
||||||
|
|
||||||
|
|
||||||
BertLayerNorm = torch.nn.LayerNorm
|
BertLayerNorm = torch.nn.LayerNorm
|
||||||
|
|||||||
Reference in New Issue
Block a user