forked from SuperBruceJia/EEG-DL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDraw_Loss_Photo.m
92 lines (81 loc) · 3.21 KB
/
Draw_Loss_Photo.m
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
clear all
clc
format long
model1 = readmatrix("Model_1/run-.-tag-loss.csv");
model2 = readmatrix("Model_2/run-.-tag-loss.csv");
model3 = readmatrix("Model_3/run-.-tag-loss.csv");
model4 = readmatrix("Model_4/run-.-tag-loss.csv");
model5 = readmatrix("Model_5/run-.-tag-loss.csv");
model6 = readmatrix("Model_6/run-.-tag-loss.csv");
model7 = readmatrix("Model_7/run-.-tag-loss.csv");
model8 = readmatrix("Model_8/run-.-tag-loss.csv");
model9 = readmatrix("Model_9/run-.-tag-loss.csv");
model10 = readmatrix("Model_10/run-.-tag-loss.csv");
model11 = readmatrix("Model_11/run-.-tag-loss.csv");
model12 = readmatrix("Model_12/run-.-tag-loss.csv");
model1_x_axis = model1(:, 2);
model1_y_axis = model1(:, 3);
model2_x_axis = model2(:, 2);
model2_y_axis = model2(:, 3);
model3_x_axis = model3(:, 2);
model3_y_axis = model3(:, 3);
model4_x_axis = model4(:, 2);
model4_y_axis = model4(:, 3);
model5_x_axis = model5(:, 2);
model5_y_axis = model5(:, 3);
model6_x_axis = model6(:, 2);
model6_y_axis = model6(:, 3);
model7_x_axis = model7(:, 2);
model7_y_axis = model7(:, 3);
model8_x_axis = model8(:, 2);
model8_y_axis = model8(:, 3);
model9_x_axis = model9(:, 2);
model9_y_axis = model9(:, 3);
model10_x_axis = model10(:, 2);
model10_y_axis = model10(:, 3);
model11_x_axis = model11(:, 2);
model11_y_axis = model11(:, 3);
model12_x_axis = model12(:, 2);
model12_y_axis = model12(:, 3);
color=[1 0 0; 0 1 0; 0 0 1; 0.5 1 1;
1 1 0.5; 1 0.5 1; 0 0 0.5; 0.5 0 0;
0 0.5 0; 1 0.5 0.5; 0.5 1 0.5; 0.5 0.5 1;
1 1 0;0 1 1;1 0 1];
% Draw the Images
figure(1)
plot(model1_x_axis, model1_y_axis, 'linewidth', 1.2, 'color', color(8, :));
hold on
plot(model2_x_axis, model2_y_axis, 'linewidth', 1.2, 'color', color(2, :));
hold on
plot(model3_x_axis, model3_y_axis, 'linewidth', 1.2, 'color', color(3, :));
hold on
plot(model4_x_axis, model4_y_axis, 'linewidth', 1.2, 'color', color(4, :));
hold on
plot(model5_x_axis, model5_y_axis, 'linewidth', 1.2, 'color', color(5, :));
hold on
plot(model6_x_axis, model6_y_axis, 'linewidth', 1.2, 'color', color(6, :));
hold on
plot(model7_x_axis, model7_y_axis, 'linewidth', 1.2, 'color', color(7, :));
hold on
plot(model8_x_axis, model8_y_axis, 'linewidth', 1.2, 'color', color(1, :));
hold on
plot(model9_x_axis, model9_y_axis, 'linewidth', 1.2, 'color', color(9, :));
hold on
plot(model10_x_axis, model10_y_axis, 'linewidth', 1.2, 'color', color(10, :));
hold on
plot(model11_x_axis, model11_y_axis, 'linewidth', 1.2, 'color', 'k');
hold on
plot(model12_x_axis, model12_y_axis, 'linewidth', 1.2, 'color', color(12, :));
hold on
grid on
xlim([0, 310])
title({'Loss w.r.t. RNN-based Models'}, 'FontName', 'Times New Roman', 'FontSize', 16, 'FontWeight', 'bold')
xlabel('Iterations')
ylabel('Loss Value')
set(gca, 'FontName', 'Times New Roman', 'FontSize', 16, 'FontWeight', 'bold');
legend('RNN', 'BiRNN', 'RNN with Attention', 'BiRNN with Attention', ...
'LSTM', 'BiLSTM', 'LSTM with Attention', 'BiLSTM with Attention', ...
'GRU', 'BiGRU', 'GRU with Attention', 'BiGRU with Attention', ...
'location', 'EastOutside', 'FontName', 'Times New Roman', 'FontSize', 16)
legend('boxoff')
print('Loss_RNN_basedModels', '-dpng', '-r600')