-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
22 lines (19 loc) · 658 Bytes
/
Copy pathplot.py
File metadata and controls
22 lines (19 loc) · 658 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pyplot as plt
def plot_runing_avg_learning_curve(x, scores,title, figure_file):
fig = plt.figure(figsize=(8,6))
ax = fig.add_subplot(1,1,1)
running_avg = np.zeros(len(scores))
for i in range(len(running_avg)):
running_avg[i] = np.mean(scores[max(0, i-100):(i+1)])
ax.plot(x, running_avg)
ax.set_title(title)
fig.savefig(figure_file)
def plot_learning_curve(x, scores,title, figure_file):
fig = plt.figure(figsize=(8,6))
ax = fig.add_subplot(1,1,1)
ax.plot(x, scores)
ax.set_title(title)
fig.savefig(figure_file)