-
Notifications
You must be signed in to change notification settings - Fork 2
/
bar.m
69 lines (56 loc) · 2.05 KB
/
bar.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
clc
clear all
close all
% add path
addpath(genpath(fullfile(pwd)))
p.name = '50%culling'; % A name for the experiment
p.turns = false; % Whether to use turns in the localisation process
p.topk = 1; % Save the topk best routes
dataset = 'wallstreet5k';
groups = 8;
range = 5:5:20;
data = zeros(size(range,2),3);
%% load ranking using 2D+2.5D
p.results_dir = 'results/MES'; % Results directory
p.type = 'MES';
p.network = 'dgcnn2to3';
path = fullfile(p.results_dir, dataset, num2str(p.turns), p.network, [p.name,'.mat']);
load(path,'ranking');
acc = sum(ranking > 0 & ranking <= p.topk, 1) / size(ranking,1);
col = acc(1,range)';
data(:,3) = col;
%% load ranking using 2D
p.results_dir = 'results/MES'; % Results directory
p.type = 'MES';
p.network = '2dsafapolar';
path = fullfile(p.results_dir, dataset, num2str(p.turns), p.network, [p.name,'.mat']);
load(path,'ranking');
acc = sum(ranking > 0 & ranking <= p.topk, 1) / size(ranking,1);
col = acc(1,range)';
data(:,2) = col;
p.results_dir = 'results/MES'; % Results directory
p.type = 'MES';
p.network = '2d';
path = fullfile(p.results_dir, dataset, num2str(p.turns), p.network, [p.name,'.mat']);
load(path,'ranking');
acc = sum(ranking > 0 & ranking <= p.topk, 1) / size(ranking,1);
col = acc(1,range)';
data(:,1) = col;
file_name = fullfile('exps', ['data.mat']);
save(file_name,'data');
data = 100 * data;
%% Make plot
b = bar(range, data, 'FaceColor','flat','EdgeColor',[1 1 1]);
b(1).FaceColor = 'r';
b(2).FaceColor = 'b';
b(3).FaceColor = [0.4660,0.6740,0.1880];
set(gca,'FontName','Times','FontSize',20,'FontWeight','bold');
xlabel('Route length', 'FontName', 'Times','FontSize',20,'FontName','Times','FontWeight','bold')
ylabel('Top-1 Localisations (%)', 'FontName', 'Times', 'FontSize',20,'FontName','Times','FontWeight','bold')
grid on
ax = gca;
set(ax,'Ytick',60:10:100)
ylim([60,100]);
legend({'ES', 'SAFA-Pol', 'Ours'}, 'FontName', 'Times', 'Location', 'northwest','FontSize',16,'FontWeight','bold')
filename = fullfile('figures', 'bars.eps');
print(gcf, '-depsc', filename);