October 2018
Intermediate to advanced
472 pages
10h 57m
English
The following performance_plot function plots the performance of the model over time. This function has been placed such that it is only plotted once our target of 200 points has been reached. You can also place this function to plot the progress after every 100 episodes during training:
def performance_plot(scores, target_score): """Plot the game progress.""" scores_arr = np.array(scores) # convert list to array scores_arr[np.where(scores_arr > target_score)] = target_score # scores plt.figure(figsize=(20, 5)) # set figure size to 20 by 5 plt.title('Plot of Score v/s Episode') # title plt.xlabel('Episodes') # xlabel plt.ylabel('Scores') # ylabel plt.plot(scores_arr) plt.show()
A sample plot output of the function ...
Read now
Unlock full access