From f1fffe022253e7de0f507d674d34ccdcd9a79d24 Mon Sep 17 00:00:00 2001 From: NoviScl Date: Fri, 26 Jul 2019 10:31:33 +0800 Subject: [PATCH] fix --- README.md | 2 ++ run.sh | 2 +- run_xlnet_dream.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 014d286..387fc5d 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Author: Chenglei Si (River Valley High School, Singapore) Update: Sometimes you may get degenerate runs where the performance is far lower than the expected performance. This is mainly because the training is not stable on smaller datasets. You may try to change the random seeds (and perhaps learning rate, batch size, warmup steps or other hyperparameters as well) and restart training. If you want, I can send you a trained checkpoint. Feel free to contact me through email: sichenglei1125@gmail.com +Note: +You should use the dev set to do hyper-parameter tuning and then use the test file and trained model to evaluate on the test data. This is the standard practice for ML. Usage: diff --git a/run.sh b/run.sh index b4fa037..9bc2a5e 100644 --- a/run.sh +++ b/run.sh @@ -1,2 +1,2 @@ python run_xlnet_dream.py --data_dir=data --xlnet_model=xlnet-large-cased --output_dir=xlnet_dream --max_seq_length=256 --do_train --do_eval --train_batch_size=32 --eval_batch_size=1 --learning_rate=1e-5 --num_train_epochs=4 --warmup_proportion=0.1 --gradient_accumulation_steps=32 && /root/shutdown.sh -python run_xlnet_dream.py --data_dir=data --xlnet_model=xlnet-large-cased --output_dir=xlnet_dream --max_seq_length=128 --do_train --do_eval --train_batch_size=32 --eval_batch_size=2 --learning_rate=2e-5 --num_train_epochs=3 --warmup_steps=120 --weight_decay=0.0 --adam_epsilon=1e-8 --gradient_accumulation_steps=16 && /root/shutdown.sh +python run_xlnet_dream.py --data_dir=data --xlnet_model=xlnet-large-cased --output_dir=xlnet_dream --max_seq_length=128 --do_train --do_eval --train_batch_size=32 --eval_batch_size=2 --learning_rate=2e-5 --num_train_epochs=3 --warmup_steps=120 --weight_decay=0.0 --adam_epsilon=1e-6 --gradient_accumulation_steps=16 && /root/shutdown.sh diff --git a/run_xlnet_dream.py b/run_xlnet_dream.py index a8e01fc..032eff8 100644 --- a/run_xlnet_dream.py +++ b/run_xlnet_dream.py @@ -580,11 +580,11 @@ def main(): if args.do_eval: - eval_examples = processor.get_test_examples(args.data_dir) + eval_examples = processor.get_dev_examples(args.data_dir) eval_features = convert_examples_to_features( eval_examples, label_list, args.max_seq_length, tokenizer) - logger.info("***** Running evaluation *****") + logger.info("***** Running Dev Evaluation *****") logger.info(" Num examples = %d", len(eval_examples)) logger.info(" Batch size = %d", args.eval_batch_size)