October 2018
Intermediate to advanced
472 pages
10h 57m
English
Once the agent has been trained, we evaluate its performance over 100 new episodes. This can be done by calling the .test function and feeding the arguments environment and number of episodes on which to test:
# Evaluate the agent on 100 new episodesscores = sarsa.test(env, nb_episodes=100, visualize=False)print('Average score over 100 test games: {}'.format(np.mean(scores.history['episode_reward'])))
The following is the output after testing 100 episodes:

Following the the output at the end of the code execution: ...
Read now
Unlock full access