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
f2b300df
Commit
f2b300df
authored
Aug 08, 2019
by
LysandreJik
Browse files
fix #976
parent
7df303f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
pytorch_transformers/modeling_bert.py
pytorch_transformers/modeling_bert.py
+2
-2
pytorch_transformers/modeling_xlm.py
pytorch_transformers/modeling_xlm.py
+1
-1
pytorch_transformers/modeling_xlnet.py
pytorch_transformers/modeling_xlnet.py
+1
-1
No files found.
pytorch_transformers/modeling_bert.py
View file @
f2b300df
...
@@ -925,7 +925,7 @@ class BertForSequenceClassification(BertPreTrainedModel):
...
@@ -925,7 +925,7 @@ class BertForSequenceClassification(BertPreTrainedModel):
r
"""
r
"""
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
Labels for computing the sequence classification/regression loss.
Labels for computing the sequence classification/regression loss.
Indices should be in ``[0, ..., config.num_labels]``.
Indices should be in ``[0, ..., config.num_labels
- 1
]``.
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
...
@@ -1099,7 +1099,7 @@ class BertForTokenClassification(BertPreTrainedModel):
...
@@ -1099,7 +1099,7 @@ class BertForTokenClassification(BertPreTrainedModel):
r
"""
r
"""
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size, sequence_length)``:
Labels for computing the token classification loss.
Labels for computing the token classification loss.
Indices should be in ``[0, ..., config.num_labels]``.
Indices should be in ``[0, ..., config.num_labels
- 1
]``.
Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs:
Outputs: `Tuple` comprising various elements depending on the configuration (config) and inputs:
**loss**: (`optional`, returned when ``labels`` is provided) ``torch.FloatTensor`` of shape ``(1,)``:
**loss**: (`optional`, returned when ``labels`` is provided) ``torch.FloatTensor`` of shape ``(1,)``:
...
...
pytorch_transformers/modeling_xlm.py
View file @
f2b300df
...
@@ -784,7 +784,7 @@ class XLMForSequenceClassification(XLMPreTrainedModel):
...
@@ -784,7 +784,7 @@ class XLMForSequenceClassification(XLMPreTrainedModel):
r
"""
r
"""
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
Labels for computing the sequence classification/regression loss.
Labels for computing the sequence classification/regression loss.
Indices should be in ``[0, ..., config.num_labels]``.
Indices should be in ``[0, ..., config.num_labels
- 1
]``.
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
...
...
pytorch_transformers/modeling_xlnet.py
View file @
f2b300df
...
@@ -1075,7 +1075,7 @@ class XLNetForSequenceClassification(XLNetPreTrainedModel):
...
@@ -1075,7 +1075,7 @@ class XLNetForSequenceClassification(XLNetPreTrainedModel):
r
"""
r
"""
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
**labels**: (`optional`) ``torch.LongTensor`` of shape ``(batch_size,)``:
Labels for computing the sequence classification/regression loss.
Labels for computing the sequence classification/regression loss.
Indices should be in ``[0, ..., config.num_labels]``.
Indices should be in ``[0, ..., config.num_labels
- 1
]``.
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels == 1`` a regression loss is computed (Mean-Square loss),
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
If ``config.num_labels > 1`` a classification loss is computed (Cross-Entropy).
...
...
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