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
08de989a
Unverified
Commit
08de989a
authored
Sep 07, 2020
by
Sylvain Gugger
Committed by
GitHub
Sep 07, 2020
Browse files
Trainer with grad accum (#6930)
* Add warning for gradient accumulation * Formatting
parent
d4aa7284
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/transformers/training_args.py
src/transformers/training_args.py
+6
-0
src/transformers/training_args_tf.py
src/transformers/training_args_tf.py
+6
-0
No files found.
src/transformers/training_args.py
View file @
08de989a
...
@@ -60,6 +60,12 @@ class TrainingArguments:
...
@@ -60,6 +60,12 @@ class TrainingArguments:
The batch size per GPU/TPU core/CPU for evaluation.
The batch size per GPU/TPU core/CPU for evaluation.
gradient_accumulation_steps: (:obj:`int`, `optional`, defaults to 1):
gradient_accumulation_steps: (:obj:`int`, `optional`, defaults to 1):
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.
.. warning::
When using gradient accumulation, one step is counted as one step with backward pass. Therefore,
logging, evaluation, save will be conducted every ``gradient_accumulation_steps * xxx_step`` training
examples.
learning_rate (:obj:`float`, `optional`, defaults to 5e-5):
learning_rate (:obj:`float`, `optional`, defaults to 5e-5):
The initial learning rate for Adam.
The initial learning rate for Adam.
weight_decay (:obj:`float`, `optional`, defaults to 0):
weight_decay (:obj:`float`, `optional`, defaults to 0):
...
...
src/transformers/training_args_tf.py
View file @
08de989a
...
@@ -42,6 +42,12 @@ class TFTrainingArguments(TrainingArguments):
...
@@ -42,6 +42,12 @@ class TFTrainingArguments(TrainingArguments):
The batch size per GPU/TPU core/CPU for evaluation.
The batch size per GPU/TPU core/CPU for evaluation.
gradient_accumulation_steps: (:obj:`int`, `optional`, defaults to 1):
gradient_accumulation_steps: (:obj:`int`, `optional`, defaults to 1):
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.
Number of updates steps to accumulate the gradients for, before performing a backward/update pass.
.. warning::
When using gradient accumulation, one step is counted as one step with backward pass. Therefore,
logging, evaluation, save will be conducted every ``gradient_accumulation_steps * xxx_step`` training
examples.
learning_rate (:obj:`float`, `optional`, defaults to 5e-5):
learning_rate (:obj:`float`, `optional`, defaults to 5e-5):
The initial learning rate for Adam.
The initial learning rate for Adam.
weight_decay (:obj:`float`, `optional`, defaults to 0):
weight_decay (:obj:`float`, `optional`, defaults to 0):
...
...
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