forked from sgadgil6/cnslab_fmri
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_mlp_baseline.py
44 lines (32 loc) · 1.14 KB
/
plot_mlp_baseline.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
34
35
36
37
38
39
40
41
42
43
44
import matplotlib
import matplotlib.pyplot as plt
train_epoch_list = []
train_loss_list = []
train_acc_list = []
test_epoch_list = []
test_loss_list = []
test_acc_list = []
for line in open('output/mlp_baseline/training_output.txt'):
line_split = line.split()
train_epoch_list.append(int(line_split[1]))
train_loss_list.append(float(line_split[3]))
train_acc_list.append(float(line_split[5]))
for line in open('output/mlp_baseline/testing_output.txt'):
line_split = line.split()
test_epoch_list.append(int(line_split[1]))
test_loss_list.append(float(line_split[3]))
test_acc_list.append(float(line_split[5]))
font = {'family' : 'normal',
'size' : 12}
matplotlib.rc('font', **font)
fig, ax = plt.subplots(2,2)
fig.suptitle('MLP-Baseline Output')
ax[0, 0].plot(train_epoch_list, train_loss_list)
ax[0, 0].set_title("Training Loss Curve")
ax[0, 1].plot(test_epoch_list, test_loss_list)
ax[0, 1].set_title("Testing Loss Curve")
ax[1, 0].plot(train_epoch_list, train_acc_list)
ax[1, 0].set_title("Training Acc Curve")
ax[1, 1].plot(test_epoch_list, test_acc_list)
ax[1, 1].set_title("Testing Acc Curve")
plt.show()