Skip to content

Commit 82562da

Browse files
Yibing Liuroot
authored andcommitted
Use default num_iteration_per_drop_scope
1 parent 23bf59e commit 82562da

4 files changed

Lines changed: 1 addition & 6 deletions

File tree

BERT/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ python -u run_classifier.py --task_name ${TASK_NAME} \
151151
--max_seq_len 512 \
152152
--bert_config_path ${BERT_BASE_PATH}/bert_config.json \
153153
--learning_rate 1e-4 \
154-
--skip_steps 10 \
155-
--num_iteration_per_drop_scope 1
154+
--skip_steps 10
156155
```
157156

158157
这里的 `chinese_L-12_H-768_A-12` 即是转换后的中文预训练模型。需要注意的是,BERT on PaddlePaddle 支持按两种方式构建一个 batch 的数据,`in_tokens` 参数影响 `batch_size` 参数的意义,如果 `in_tokens``true` 则按照 token 个数构建 batch, 如不设定则按照 example 个数来构建 batch. 训练过程中会输出训练误差、训练速度等信息,训练结束后会输出如下所示的在验证集上的测试结果:

BERT/run_classifier.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
run_type_g = ArgumentGroup(parser, "run_type", "running type options.")
7777
run_type_g.add_arg("use_cuda", bool, True, "If set, use GPU for training.")
7878
run_type_g.add_arg("use_fast_executor", bool, False, "If set, use fast parallel executor (in experiment).")
79-
run_type_g.add_arg("num_iteration_per_drop_scope", int, 10, "Iteration intervals to drop scope.")
8079
run_type_g.add_arg("task_name", str, None,
8180
"The name of task to perform fine-tuning, should be in {'xnli', 'mnli', 'cola', 'mrpc'}.")
8281
run_type_g.add_arg("do_train", bool, True, "Whether to perform training.")
@@ -248,7 +247,6 @@ def main(args):
248247
if args.use_fast_executor:
249248
exec_strategy.use_experimental_executor = True
250249
exec_strategy.num_threads = dev_count
251-
exec_strategy.num_iteration_per_drop_scope = args.num_iteration_per_drop_scope
252250

253251
train_exe = fluid.ParallelExecutor(
254252
use_cuda=args.use_cuda,

BERT/run_squad.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def train(args):
344344
if args.use_fast_executor:
345345
exec_strategy.use_experimental_executor = True
346346
exec_strategy.num_threads = dev_count
347-
exec_strategy.num_iteration_per_drop_scope = min(10, args.skip_steps)
348347

349348
train_exe = fluid.ParallelExecutor(
350349
use_cuda=args.use_cuda,

BERT/train.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ def train(args):
313313
if args.use_fast_executor:
314314
exec_strategy.use_experimental_executor = True
315315
exec_strategy.num_threads = dev_count
316-
exec_strategy.num_iteration_per_drop_scope = min(10, args.skip_steps)
317316

318317
build_strategy = fluid.BuildStrategy()
319318
build_strategy.remove_unnecessary_lock = False

0 commit comments

Comments
 (0)