From 8af114e66dd701598b8fe5e2dd0094131c106134 Mon Sep 17 00:00:00 2001 From: Yibing Liu Date: Thu, 28 Sep 2017 10:19:23 +0800 Subject: [PATCH] adjust parsing order --- deep_speech_2/tools/parse_tuning_log.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deep_speech_2/tools/parse_tuning_log.py b/deep_speech_2/tools/parse_tuning_log.py index fa7873ee..26c11ecf 100644 --- a/deep_speech_2/tools/parse_tuning_log.py +++ b/deep_speech_2/tools/parse_tuning_log.py @@ -61,17 +61,17 @@ def parse_log(): with open(args.log_path, "r") as log_file: line = log_file.readline() while line: - if line.find("error_rate_type:") != -1: + if err_rate_pat.match(line) is not None: + triple = num_pat.findall(line) + alphas.append(float(triple[0])) + betas.append(float(triple[1])) + err_ave.append(float(triple[2])) + elif line.find("error_rate_type:") != -1: error_rate_type = line.strip().split()[1] elif line.find("num_alphas:") != -1: num_alphas = int(line.strip().split()[1]) elif line.find("num_betas:") != -1: num_betas = int(line.strip().split()[1]) - elif err_rate_pat.match(line) is not None: - tuples = num_pat.findall(line) - alphas.append(float(tuples[0])) - betas.append(float(tuples[1])) - err_ave.append(float(tuples[2])) line = log_file.readline() if error_rate_type == None: -- GitLab