forked from Alexflex/HNNC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmlpPlot.m
60 lines (53 loc) · 1.5 KB
/
mlpPlot.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
function mlpPlot(path, learnInfo, showAfterSave)
% Ïîñòðîåíèå ãðàôèêà ïðîöåññà îáó÷åíèÿ è òåñòèðîâàíèÿ ÌÑÏ
%
% mlpPlot(path, learnInfo, showAfterSave)
%
% Arguments
% path - èìÿ ôàéëà, â êîòîðûé áóäåò ñîõðàíåí ãðàôèê
% learnInfo - èñõîäíûå äàííûå î ïðîöåññå îáó÷åíèÿ
% showAfterSave - ïîêàçûâàòü ãðàôèê ïîñëå ñîõðàíåíèÿ
%
% Example
% mlpPlot(char(path), learnInfo, true);
%
% See also
%
%
% Revisions
% Author: Vulfin Alex, Date: 17/11/2010
% Supervisor: Vulfin Alex, Date: 17/11/2010
% Author: (Next revision author), Date: (Next revision date)
% Create figure
fig = figure( 'PaperPosition', [0.6345 6.345 20.3 15.23], ...
'PaperSize', [20.98 29.68]);
hold on;
plot(learnInfo.training.RE, '-r');
plot(learnInfo.training.CE, ':r');
leg = {'Training Regression'};
leg{end + 1} = 'Training Classification';
if (~isempty(learnInfo.validation.RE))
plot(learnInfo.validation.RE, '-g');
plot(learnInfo.validation.CE, ':g');
leg{end + 1} = 'Validation Regression';
leg{end + 1} = 'Validation Classification';
end
if (~isempty(learnInfo.test.RE))
plot(learnInfo.test.RE, '-b');
plot(learnInfo.test.CE, ':b');
leg{end + 1} = 'Test Regression';
leg{end + 1} = 'Test Classification';
end
hold off
str = sprintf('Error vs. Learning Time, MSE = %15.10f', ...
learnInfo.training.RE(end));
title(str);
xlabel('Epochs');
ylabel('MSE');
legend(leg);
saveas(fig, path, 'png');
% åñëè ôëàã ïîêàçà ðèñóíêà ñáðîøåí, òî çàêðûòü ðèñóíîê
if(~showAfterSave)
close(fig);
end
end % of function