-
Notifications
You must be signed in to change notification settings - Fork 9
/
testToy.m
90 lines (76 loc) · 2.82 KB
/
testToy.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
% Testing the performance of different graph matching methods on the toy dataset.
% This is a similar function used for reporting (Fig. 4) the first experiment (Sec 5.1) in the CVPR 2012 paper.
%
% History
% create - Feng Zhou ([email protected]), 09-01-2012
% modify - Feng Zhou ([email protected]), 05-08-2013
clear variables;
prSet(4);
%% save flag
svL = 2; % change svL = 1 if you want to re-run the experiments.
%% algorithm parameter
tagAlg = 2;
[~, algs] = gmPar(tagAlg);
%% run 1 (outliers)
tagSrc = 1;
[~, val1s] = toyAsgPar(tagSrc);
wsRun1 = toyAsgRunD(tagSrc, tagAlg, 'svL', svL);
[Me1, Dev1, ObjMe1, ObjDev1] = stFld(wsRun1, 'Me', 'Dev', 'ObjMe', 'ObjDev');
%% run 2 (deformation)
tagSrc = 2;
[~, val2s] = toyAsgPar(tagSrc);
wsRun2 = toyAsgRunD(tagSrc, tagAlg, 'svL', svL);
[Me2, Dev2, ObjMe2, ObjDev2] = stFld(wsRun2, 'Me', 'Dev', 'ObjMe', 'ObjDev');
%% run 3 (sparseness)
tagSrc = 3;
[~, val3s] = toyAsgPar(tagSrc);
wsRun3 = toyAsgRunD(tagSrc, tagAlg, 'svL', svL);
[Me3, Dev3, ObjMe3, ObjDev3] = stFld(wsRun3, 'Me', 'Dev', 'ObjMe', 'ObjDev');
%% show accuracy & objective
rows = 1; cols = 7;
Ax = iniAx(1, rows, cols, [250 * rows, 250 * cols]);
shCur(Me1, Dev1, 'ax', Ax{1}, 'dev', 'y');
xticks = 1 : 2 : size(Me1, 2);
setAxTick('x', '%d', xticks, val1s(xticks));
set(gca, 'ylim', [0 1.1], 'ytick', 0 : .2 : 1, 'xlim', [.5, size(Me1, 2) + .5]);
axis square;
xlabel('outlier');
ylabel('accuracy');
shCur(ObjMe1, ObjDev1, 'ax', Ax{2}, 'dev', 'y');
xticks = 1 : 2 : size(ObjMe1, 2);
setAxTick('x', '%d', xticks, val1s(xticks));
set(gca, 'ylim', [.4 1.05], 'ytick', .2 : .1 : 1, 'xlim', [.5, size(Me1, 2) + .5]);
axis square;
xlabel('outlier');
ylabel('objective ratio');
shCur(Me2, Dev2, 'ax', Ax{3}, 'dev', 'y');
xticks = 1 : 2 : size(Me2, 2);
setAxTick('x', '%.2f', xticks, val2s(xticks));
set(gca, 'ylim', [0 1.1], 'ytick', 0 : .2 : 1, 'xlim', [.5, size(Me2, 2) + .5]);
axis square;
xlabel('edge deformation');
ylabel('accuracy');
shCur(ObjMe2, ObjDev2, 'ax', Ax{4}, 'dev', 'y');
xticks = 1 : 2 : size(ObjMe2, 2);
setAxTick('x', '%.2f', xticks, val2s(xticks));
set(gca, 'ylim', [.4 1.05], 'ytick', .2 : .1 : 1, 'xlim', [.5, size(Me2, 2) + .5]);
axis square;
xlabel('edge deformation');
ylabel('objective ratio');
shCur(Me3, Dev3, 'ax', Ax{5}, 'dev', 'y');
xticks = 1 : 2 : size(Me3, 2);
setAxTick('x', '%.1f', xticks, val3s(xticks));
set(gca, 'ylim', [0 1.1], 'ytick', 0 : .2 : 1, 'xlim', [.5, size(Me3, 2) + .5]);
axis square;
xlabel('edge sparseness');
ylabel('accuracy');
shCur(ObjMe3, ObjDev3, 'ax', Ax{6}, 'dev', 'y');
xticks = 1 : 2 : size(ObjMe3, 2);
setAxTick('x', '%.1f', xticks, val3s(xticks));
set(gca, 'ylim', [.4 1.05], 'ytick', .2 : .1 : 1, 'xlim', [.5, size(Me3, 2) + .5]);
axis square;
xlabel('edge sparseness');
ylabel('objective ratio');
shCur(Me1, Dev1, 'ax', Ax{7}, 'dev', 'n', 'algs', algs);
set(Ax{7}, 'visible', 'off');
cla;