Skip to content
Snippets Groups Projects
Commit 3bbf1cea authored by Erik Nygren's avatar Erik Nygren
Browse files

updated level parameters for training

parent c61daad7
No related branches found
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ for trials in range(1, n_trials + 1): ...@@ -74,7 +74,7 @@ for trials in range(1, n_trials + 1):
#print(step) #print(step)
# Action # Action
for a in range(env.number_of_agents): for a in range(env.number_of_agents):
action = agent.act(np.array(obs[a]), eps=0) action = agent.act(np.array(obs[a]), eps=eps)
action_prob[action] += 1 action_prob[action] += 1
action_dict.update({a: action}) action_dict.update({a: action})
...@@ -110,7 +110,7 @@ for trials in range(1, n_trials + 1): ...@@ -110,7 +110,7 @@ for trials in range(1, n_trials + 1):
eps, action_prob/np.sum(action_prob)), eps, action_prob/np.sum(action_prob)),
end=" ") end=" ")
if trials % 100 == 0: if trials % 100 == 0:
action_prob = [1]*4
print( print(
'\rTraining {} Agents.\tEpisode {}\tAverage Score: {:.0f}\tDones: {:.2f}%\tEpsilon: {:.2f} \t Action Probabilities: \t {}'.format( '\rTraining {} Agents.\tEpisode {}\tAverage Score: {:.0f}\tDones: {:.2f}%\tEpsilon: {:.2f} \t Action Probabilities: \t {}'.format(
env.number_of_agents, env.number_of_agents,
...@@ -122,4 +122,4 @@ for trials in range(1, n_trials + 1): ...@@ -122,4 +122,4 @@ for trials in range(1, n_trials + 1):
eps, action_prob / np.sum(action_prob))) eps, action_prob / np.sum(action_prob)))
torch.save(agent.qnetwork_local.state_dict(), torch.save(agent.qnetwork_local.state_dict(),
'../flatland/baselines/Nets/avoid_checkpoint' + str(trials) + '.pth') '../flatland/baselines/Nets/avoid_checkpoint' + str(trials) + '.pth')
action_prob = [1]*4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment