From f9e27ed67c7d3a7c0f63899e254ad9532285436b Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Thu, 9 Aug 2018 02:52:35 +0000 Subject: [PATCH] Tiny fixes in text_cls ce --- fluid/sequence_tagging_for_ner/train.py | 2 +- fluid/text_classification/.run_ce.sh | 0 fluid/text_classification/_ce.py | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 fluid/text_classification/.run_ce.sh diff --git a/fluid/sequence_tagging_for_ner/train.py b/fluid/sequence_tagging_for_ner/train.py index 6ed77cd5..8aaf660f 100644 --- a/fluid/sequence_tagging_for_ner/train.py +++ b/fluid/sequence_tagging_for_ner/train.py @@ -53,7 +53,7 @@ def main(train_data_file, test_data_file, vocab_file, target_file, emb_file, chunk_scheme="IOB", num_chunk_types=int(math.ceil((label_dict_len - 1) / 2.0))) - inference_program = fluid.default_main_program().clone() + inference_program = fluid.default_main_program().clone(for_test=True) with fluid.program_guard(inference_program): test_target = chunk_evaluator.metrics + chunk_evaluator.states inference_program = fluid.io.get_inference_program(test_target) diff --git a/fluid/text_classification/.run_ce.sh b/fluid/text_classification/.run_ce.sh old mode 100644 new mode 100755 diff --git a/fluid/text_classification/_ce.py b/fluid/text_classification/_ce.py index 61584e74..10035720 100644 --- a/fluid/text_classification/_ce.py +++ b/fluid/text_classification/_ce.py @@ -9,7 +9,7 @@ from kpi import CostKpi, DurationKpi, AccKpi train_acc_kpi = AccKpi('train_acc', 0.005, actived=True) train_cost_kpi = CostKpi('train_cost', 0.005, actived=True) -train_duration_kpi = DurationKpi('train_duration', 0.06, actived=True) +train_duration_kpi = DurationKpi('train_duration', 0.05, actived=True) tracking_kpis = [ train_acc_kpi, @@ -43,6 +43,6 @@ def log_to_ce(log): if __name__ == '__main__': log = sys.stdin.read() print("*****") - print log + print(log) print("****") log_to_ce(log) -- GitLab