Skip to content
Snippets Groups Projects
Commit b7a0a83c authored by Armin Co's avatar Armin Co
Browse files

Only show log if there is a "offline" history.

parent 48fff114
No related branches found
No related tags found
No related merge requests found
......@@ -77,7 +77,6 @@ def one_episode(environment, agent, render, learn, conf=None, max_steps=1000):
def learn_offline(agent, conf):
""" Train the agent with its memories. """
print('Learning with ', len(agent.memory.history), ' memories.')
agent.epsilon = agent.epsilon_min
score_history = []
avg_score_history = []
......@@ -89,6 +88,7 @@ def learn_offline(agent, conf):
pbar.set_description(desc)
pbar.refresh()
if i % conf.offline_validate_every_x_iteration == 1 and conf.offline_validate_every_x_iteration is not -1:
agent.epsilon = agent.epsilon_min
score = one_episode(conf.env, agent, conf.render, False, conf=conf)
score_history.append(score)
is_solved = np.mean(score_history[-25:])
......@@ -96,6 +96,7 @@ def learn_offline(agent, conf):
avg_score_history.append(is_solved)
if is_solved > IS_SOLVED:
break
if conf.offline_validate_every_x_iteration is not -1:
process_logs(avg_score_history, score_history, conf)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment