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
a9debaca
Commit
a9debaca
authored
Sep 16, 2019
by
erenup
Browse files
fixed init_weight
parent
982f181a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
pytorch_transformers/modeling_roberta.py
pytorch_transformers/modeling_roberta.py
+1
-1
pytorch_transformers/modeling_xlnet.py
pytorch_transformers/modeling_xlnet.py
+1
-1
No files found.
pytorch_transformers/modeling_roberta.py
View file @
a9debaca
...
@@ -418,7 +418,7 @@ class RobertaForMultipleChoice(BertPreTrainedModel):
...
@@ -418,7 +418,7 @@ class RobertaForMultipleChoice(BertPreTrainedModel):
self
.
dropout
=
nn
.
Dropout
(
config
.
hidden_dropout_prob
)
self
.
dropout
=
nn
.
Dropout
(
config
.
hidden_dropout_prob
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
classifier
=
nn
.
Linear
(
config
.
hidden_size
,
1
)
self
.
apply
(
self
.
init_weights
)
self
.
init_weights
(
)
def
forward
(
self
,
input_ids
,
token_type_ids
=
None
,
attention_mask
=
None
,
labels
=
None
,
def
forward
(
self
,
input_ids
,
token_type_ids
=
None
,
attention_mask
=
None
,
labels
=
None
,
position_ids
=
None
,
head_mask
=
None
):
position_ids
=
None
,
head_mask
=
None
):
...
...
pytorch_transformers/modeling_xlnet.py
View file @
a9debaca
...
@@ -1065,7 +1065,7 @@ class XLNetForMultipleChoice(XLNetPreTrainedModel):
...
@@ -1065,7 +1065,7 @@ class XLNetForMultipleChoice(XLNetPreTrainedModel):
self
.
sequence_summary
=
SequenceSummary
(
config
)
self
.
sequence_summary
=
SequenceSummary
(
config
)
self
.
logits_proj
=
nn
.
Linear
(
config
.
d_model
,
1
)
self
.
logits_proj
=
nn
.
Linear
(
config
.
d_model
,
1
)
self
.
apply
(
self
.
init_weights
)
self
.
init_weights
(
)
def
forward
(
self
,
input_ids
,
token_type_ids
=
None
,
input_mask
=
None
,
attention_mask
=
None
,
def
forward
(
self
,
input_ids
,
token_type_ids
=
None
,
input_mask
=
None
,
attention_mask
=
None
,
mems
=
None
,
perm_mask
=
None
,
target_mapping
=
None
,
mems
=
None
,
perm_mask
=
None
,
target_mapping
=
None
,
...
...
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