forked from willzma/ABAGAIL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplotSimulatedAnnealing.m
34 lines (30 loc) · 998 Bytes
/
plotSimulatedAnnealing.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
%% plot Simulated Annealing Cooling Rate
clear
close all
coolingRates = [10, 50, 70, 80, 90, 99];
baseFileName = 'SAjack_Results';
% files = {};
legendVals = {};
for i = 1:length(coolingRates)
file = [baseFileName, num2str(coolingRates(i)), '.csv'];
str = sprintf('Cooling Rate = %d', coolingRates(i));
legendVals{i} = str;
num = xlsread(file);
iterations = num(2:end,1);
trainingError = num(2:end,2);
testError = num(2:end, 3);
figure(1);
hold on
plot(iterations,trainingError, 'LineWidth', 2);
figure(2);
hold on
plot(iterations, testError, 'LineWidth', 2);
end
figure(1)
xlabel('Iterations', 'Interpreter', 'latex', 'FontSize', 14);
ylabel('Error', 'Interpreter', 'latex', 'FontSize', 14);
legend(legendVals, 'Interpreter', 'latex', 'FontSize', 14);
figure(2)
xlabel('Iterations', 'Interpreter', 'latex', 'FontSize', 14);
ylabel('Error', 'Interpreter', 'latex', 'FontSize', 14);
legend(legendVals, 'Interpreter', 'latex', 'FontSize', 14);