mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Merge pull request #1753 from digantamisra98/patch-1
Added Mish Activation Function
This commit is contained in:
commit
49a69d5b78
@ -138,7 +138,11 @@ def swish(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
|
||||
|
Loading…
Reference in New Issue
Block a user