-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot_results.py
66 lines (56 loc) · 1.93 KB
/
plot_results.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
if __name__ == "__main__":
# plot EEG
EEGNet_dict = {
'elu': 'elu_5e-3_amsgrad',
'relu': 'relu_1e-3',
'leaky_relu': 'leaky_relu_1e-2_init_amsgrad'
}
plt.figure()
plt.rcParams["font.family"] = "serif"
X = np.linspace(1, 500, 500, endpoint=True)
for act in EEGNet_dict:
name = EEGNet_dict[act]
filename = "./results/EEGNet/EEGNet_" + name + '-train_acc.csv'
data = pd.read_csv(filename)
acc = data['Value']
acc *= 100
plt.plot(X, acc, label=act + '_train')
filename = "./results/EEGNet/EEGNet_" + name + '-eval_acc.csv'
data = pd.read_csv(filename)
acc = data['Value']
acc *= 100
plt.plot(X, acc, label=act + '_test')
plt.xlabel("Epoch")
plt.ylabel("Accuracy(%)")
plt.legend()
plt.title("Activation function comparison(EEGNet)")
plt.savefig("./results/EEGNet/EEGNet_acc.jpg")
# plot DeepConvNet
DeepConvNet_dict = {
'elu': 'elu_1e-3_amsgrad',
'relu': 'relu_1e-2',
'leaky_relu': 'leaky_relu_1e-2_init_amsgrad'
}
plt.figure()
plt.rcParams["font.family"] = "serif"
X = np.linspace(1, 500, 500, endpoint=True)
for act in DeepConvNet_dict:
name = DeepConvNet_dict[act]
filename = "./results/DeepConvNet/DeepConvNet_" + name + '-train_acc.csv'
data = pd.read_csv(filename)
acc = data['Value']
acc *= 100
plt.plot(X, acc, label=act + '_train')
filename = "./results/DeepConvNet/DeepConvNet_" + name + '-eval_acc.csv'
data = pd.read_csv(filename)
acc = data['Value']
acc *= 100
plt.plot(X, acc, label=act + '_test')
plt.xlabel("Epoch")
plt.ylabel("Accuracy(%)")
plt.legend()
plt.title("Activation function comparison(DeepConvNet)")
plt.savefig("./results/DeepConvNet/DeepConvNet_acc.jpg")