Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
49a69d5b
Unverified
Commit
49a69d5b
authored
Nov 28, 2019
by
Thomas Wolf
Committed by
GitHub
Nov 28, 2019
Browse files
Merge pull request #1753 from digantamisra98/patch-1
Added Mish Activation Function
parents
96e7ee72
070dcf1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
transformers/modeling_bert.py
transformers/modeling_bert.py
+5
-1
No files found.
transformers/modeling_bert.py
View file @
49a69d5b
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment