From ba4d8e617d547e5dda474ebdacc29a338c674ead Mon Sep 17 00:00:00 2001 From: Armin <armin.co@hs-bochum.de> Date: Fri, 12 Mar 2021 11:28:21 +0100 Subject: [PATCH] Save results even if learning is turned off. Make sure you change the name of the agent, otherwise the old data may be overriden. --- main.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 5214a52..a362e28 100644 --- a/main.py +++ b/main.py @@ -22,8 +22,7 @@ def run(conf): # Register an *atexit* callback, # to store the corrent result of the agent # if the program is interrupted. - if conf.learn: - atexit.register(marvin.save, conf.save_to) + atexit.register(marvin.save, conf.save_to) # Offline training of the agent with # previous collected and saved memories. @@ -38,8 +37,7 @@ def run(conf): loss, avg_score = ew.run(conf.env, marvin, conf.run_episodes, render=conf.render, learn=_LEARN, conf=conf) # Save the final training result of the agent. - if conf.learn: - marvin.save(conf.save_to) + marvin.save(conf.save_to) ew.process_logs(avg_score, loss, conf) -- GitLab