April 2019
Intermediate to advanced
212 pages
5h 34m
English
Let's go back to our randomly-acting baseline agent. We've changed the variable name, count, to epochs to distinguish each training time step from each full game loop cycle the agent completes:
state = env.reset()epochs = 0reward = 0while reward != 20: state, reward, done, info = env.step(env.action_space.sample()) epochs += 1env.render()print("Timesteps taken: {}".format(epochs))
As our first step in testing our results and comparing them to the output of other models, we're going to add in an episode loop that will make this agent run through the game loop 100 times and keep track of the results each time. We want to find the average number of steps it takes the agent to reach the ...
Read now
Unlock full access