forked from kimschmi/CerebellumForwardModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_mean_error.py
33 lines (28 loc) · 927 Bytes
/
plot_mean_error.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import sys
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
if len(sys.argv) < 2:
print("Please provide an input file.")
exit()
number_training_examples = 5000
number_epochs = 2000
recording_interval = 2
data = np.load(sys.argv[1])
training_errors = data['training_errors']
training_errors = np.reshape(training_errors, (int(number_epochs / recording_interval), number_training_examples))
mean_training_errors = np.mean(training_errors[:, :], axis=1)
nice_fonts = {
"text.usetex": True,
"font.family": "serif",
"axes.labelsize": 10,
"font.size": 10,
"legend.fontsize": 8,
"xtick.labelsize": 8,
"ytick.labelsize": 8,
}
matplotlib.rcParams.update(nice_fonts)
plt.plot(np.arange(len(mean_training_errors))*recording_interval, mean_training_errors, lw=1.)
plt.xlabel(r'Epoch')
plt.ylabel(r'Mean Error')
plt.show()