(totalrewards)
| 145 | |
| 146 | |
| 147 | def plot_running_avg(totalrewards): |
| 148 | N = len(totalrewards) |
| 149 | running_avg = np.empty(N) |
| 150 | for t in range(N): |
| 151 | running_avg[t] = totalrewards[max(0, t-100):(t+1)].mean() |
| 152 | plt.plot(running_avg) |
| 153 | plt.title("Running Average") |
| 154 | plt.show() |
| 155 | |
| 156 | |
| 157 | def main(show_plots=True): |
no outgoing calls
no test coverage detected