From b56dccdb45c6ecc0784df329a26e4f8f48d5825e Mon Sep 17 00:00:00 2001 From: saleml Date: Wed, 17 Oct 2018 11:10:30 -0400 Subject: [PATCH] Few additions to the eval_bot script: - Formatting - Show number of steps in addition to reward --- scripts/eval_bot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/eval_bot.py b/scripts/eval_bot.py index 1f484a9d..d2b1a9b8 100755 --- a/scripts/eval_bot.py +++ b/scripts/eval_bot.py @@ -68,6 +68,7 @@ num_success = 0 total_reward = 0 + total_steps = 0 for run_no in range(options.num_runs): level = level_dict[level_name] @@ -85,12 +86,13 @@ obs, reward, done, info = mission.step(action) total_reward += reward + total_steps += 1 - if done == True: + if done: if reward > 0: num_success += 1 if reward <= 0: - print('FAILURE on %s, seed %d' % (level_name, mission_seed)) + print('FAILURE on %s, seed %d, reward %.2f' % (level_name, mission_seed, reward)) break except Exception as e: print('FAILURE on %s, seed %d' % (level_name, mission_seed)) @@ -98,8 +100,9 @@ success_rate = 100 * num_success / options.num_runs mean_reward = total_reward / options.num_runs + mean_steps = total_steps / options.num_runs - print('%16s: %.1f%%, r=%.2f' % (level_name, success_rate, mean_reward)) + print('%16s: %.1f%%, r=%.3f, s=%.2f' % (level_name, success_rate, mean_reward, mean_steps)) end_time = time.time() total_time = end_time - start_time