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
9c35c132
"test/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "7c885dbba82512b8ef06f3360a7c7b150a317f69"
Commit
9c35c132
authored
Jan 17, 2019
by
thomwolf
Browse files
apex LayerNorm
parent
b9c77b98
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
pytorch_pretrained_bert/modeling_transfo_xl.py
pytorch_pretrained_bert/modeling_transfo_xl.py
+3
-3
No files found.
pytorch_pretrained_bert/modeling_transfo_xl.py
View file @
9c35c132
...
@@ -217,7 +217,7 @@ class PositionwiseFF(nn.Module):
...
@@ -217,7 +217,7 @@ class PositionwiseFF(nn.Module):
nn
.
Dropout
(
dropout
),
nn
.
Dropout
(
dropout
),
)
)
self
.
layer_norm
=
nn
.
LayerNorm
(
d_model
)
self
.
layer_norm
=
LayerNorm
(
d_model
)
self
.
pre_lnorm
=
pre_lnorm
self
.
pre_lnorm
=
pre_lnorm
...
@@ -254,7 +254,7 @@ class MultiHeadAttn(nn.Module):
...
@@ -254,7 +254,7 @@ class MultiHeadAttn(nn.Module):
self
.
dropatt
=
nn
.
Dropout
(
dropatt
)
self
.
dropatt
=
nn
.
Dropout
(
dropatt
)
self
.
o_net
=
nn
.
Linear
(
n_head
*
d_head
,
d_model
,
bias
=
False
)
self
.
o_net
=
nn
.
Linear
(
n_head
*
d_head
,
d_model
,
bias
=
False
)
self
.
layer_norm
=
nn
.
LayerNorm
(
d_model
)
self
.
layer_norm
=
LayerNorm
(
d_model
)
self
.
scale
=
1
/
(
d_head
**
0.5
)
self
.
scale
=
1
/
(
d_head
**
0.5
)
...
@@ -335,7 +335,7 @@ class RelMultiHeadAttn(nn.Module):
...
@@ -335,7 +335,7 @@ class RelMultiHeadAttn(nn.Module):
self
.
dropatt
=
nn
.
Dropout
(
dropatt
)
self
.
dropatt
=
nn
.
Dropout
(
dropatt
)
self
.
o_net
=
nn
.
Linear
(
n_head
*
d_head
,
d_model
,
bias
=
False
)
self
.
o_net
=
nn
.
Linear
(
n_head
*
d_head
,
d_model
,
bias
=
False
)
self
.
layer_norm
=
nn
.
LayerNorm
(
d_model
)
self
.
layer_norm
=
LayerNorm
(
d_model
)
self
.
scale
=
1
/
(
d_head
**
0.5
)
self
.
scale
=
1
/
(
d_head
**
0.5
)
...
...
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