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
94ff2d6e
Unverified
Commit
94ff2d6e
authored
Feb 21, 2020
by
Lysandre Debut
Committed by
GitHub
Feb 21, 2020
Browse files
Remove double bias (#2958)
parent
b5b3445c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
src/transformers/modeling_albert.py
src/transformers/modeling_albert.py
+1
-1
src/transformers/modeling_bert.py
src/transformers/modeling_bert.py
+1
-1
src/transformers/modeling_roberta.py
src/transformers/modeling_roberta.py
+1
-1
No files found.
src/transformers/modeling_albert.py
View file @
94ff2d6e
...
...
@@ -600,7 +600,7 @@ class AlbertMLMHead(nn.Module):
hidden_states
=
self
.
LayerNorm
(
hidden_states
)
hidden_states
=
self
.
decoder
(
hidden_states
)
prediction_scores
=
hidden_states
+
self
.
bias
prediction_scores
=
hidden_states
return
prediction_scores
...
...
src/transformers/modeling_bert.py
View file @
94ff2d6e
...
...
@@ -471,7 +471,7 @@ class BertLMPredictionHead(nn.Module):
def
forward
(
self
,
hidden_states
):
hidden_states
=
self
.
transform
(
hidden_states
)
hidden_states
=
self
.
decoder
(
hidden_states
)
+
self
.
bias
hidden_states
=
self
.
decoder
(
hidden_states
)
return
hidden_states
...
...
src/transformers/modeling_roberta.py
View file @
94ff2d6e
...
...
@@ -264,7 +264,7 @@ class RobertaLMHead(nn.Module):
x
=
self
.
layer_norm
(
x
)
# project back to size of vocabulary with bias
x
=
self
.
decoder
(
x
)
+
self
.
bias
x
=
self
.
decoder
(
x
)
return
x
...
...
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