MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / plot_running_avg

Function plot_running_avg

rl2/mountaincar/q_learning.py:147–154  ·  view source on GitHub ↗
(totalrewards)

Source from the content-addressed store, hash-verified

145
146
147def 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
157def main(show_plots=True):

Callers 5

n_step.pyFile · 0.90
mainFunction · 0.90
mainFunction · 0.90
td_lambda.pyFile · 0.90
mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected