From 7936c3b6605cf5dbde70132d9d78b486853fcc90 Mon Sep 17 00:00:00 2001 From: Siming Dai <908660116@qq.com> Date: Wed, 13 Mar 2024 20:38:31 +0800 Subject: [PATCH] [Trainer] Change num_train_epochs default value (#8113) * change num_train_epochs default value * update docs --- docs/trainer.md | 4 ++-- paddlenlp/trainer/training_args.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/trainer.md b/docs/trainer.md index b6db8eb215b1..8849f6ab612e 100644 --- a/docs/trainer.md +++ b/docs/trainer.md @@ -320,9 +320,9 @@ Trainer 是一个简单,但功能完整的 Paddle训练和评估模块,并 --num_train_epochs 要执行的训练 epoch 总数(如果不是整数,将在停止训练 之前执行最后一个 epoch 的小数部分百分比)。 - (`float`, 可选, 默认为 3.0): + (`float`, 可选, 默认为 1.0): - Total number of training epochs to perform. (default:3.0) + Total number of training epochs to perform. (default:1.0) --max_steps 如果设置为正数,则表示要执行的训练步骤总数。 diff --git a/paddlenlp/trainer/training_args.py b/paddlenlp/trainer/training_args.py index a0f07449d909..8398de2eb57f 100644 --- a/paddlenlp/trainer/training_args.py +++ b/paddlenlp/trainer/training_args.py @@ -126,7 +126,7 @@ class TrainingArguments: The epsilon hyperparameter for the [`AdamW`] optimizer. max_grad_norm (`float`, *optional*, defaults to 1.0): Maximum gradient norm (for gradient clipping). - num_train_epochs(`float`, *optional*, defaults to 3.0): + num_train_epochs(`float`, *optional*, defaults to 1.0): Total number of training epochs to perform (if not an integer, will perform the decimal part percents of the last epoch before stopping training). max_steps (`int`, *optional*, defaults to -1): @@ -380,7 +380,7 @@ class TrainingArguments: adam_epsilon: float = field(default=1e-8, metadata={"help": "Epsilon for AdamW optimizer."}) max_grad_norm: float = field(default=1.0, metadata={"help": "Max gradient norm."}) - num_train_epochs: float = field(default=3.0, metadata={"help": "Total number of training epochs to perform."}) + num_train_epochs: float = field(default=1.0, metadata={"help": "Total number of training epochs to perform."}) max_steps: int = field( default=-1, metadata={"help": "If > 0: set total number of training steps to perform. Override num_train_epochs."},