-
Notifications
You must be signed in to change notification settings - Fork 36
/
run_experiments.m
110 lines (93 loc) · 2.7 KB
/
run_experiments.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
function run_experiments()
setup;
path_model_vgg_m = 'data/models/imagenet-vgg-m.mat';
path_model_vgg_vd = 'data/models/imagenet-vgg-verydeep-19.mat';
path_model_alexnet = 'data/models/imagenet-caffe-alex.mat';
fix_load_nn(path_model_vgg_m);
fix_load_nn(path_model_vgg_vd);
fix_load_nn(path_model_alexnet);
% RCNN (FC-CNN) flavors
rcnn.name = 'rcnn' ;
rcnn.opts = {...
'type', 'rcnn', ...
'model', path_model_vgg_m, ...
'layer', 19} ;
rcnnalx.name = 'rcnnalx' ;
rcnnalx.opts = {...
'type', 'rcnn', ...
'model', path_model_alexnet, ...
'layer', 19} ;
rcnnvd.name = 'rcnnvd' ;
rcnnvd.opts = {...
'type', 'rcnn', ...
'model', path_model_vgg_vd, ...
'layer', 41} ;
dcnnalx.name = 'dcnnalxfv' ;
dcnnalx.opts = {...
'type', 'dcnn', ...
'model', path_model_alexnet, ...
'layer', 13, ...
'numWords', 64, ...
'encoderType', 'fv'};
dcnn.name = 'dcnnfv' ;
dcnn.opts = {...
'type', 'dcnn', ...
'model', path_model_vgg_m, ...
'layer', 13, ...
'numWords', 64, ...
'encoderType', 'fv'};
dcnnbovw.name = 'dcnnbovw' ;
dcnnbovw.opts = {...
'type', 'dcnn', ...
'model', path_model_vgg_m, ...
'layer', 13, ...
'numWords', 4096, ...
'encoderType', 'bovw'} ;
dcnnvlad.name = 'dcnnvlad' ;
dcnnvlad.opts = {...
'type', 'dcnn', ...
'model', path_model_vgg_m, ...
'layer', 13, ...
'numWords', 64, ...
'encoderType', 'vlad'} ;
dcnnvd.name = 'dcnnvdfv' ;
dcnnvd.opts = {...
'type', 'dcnn', ...
'model', path_model_vgg_vd, ...
'layer', 35, ...
'numWords', 64, ...
'encoderType', 'fv'} ;
dsift.name = 'dsift' ;
dsift.opts = {...
'type', 'dsift', ...
'numWords', 256, ...
'numPcaDimensions', 80} ;
% Set of experiments to run
setupNameList = {'rcnn', 'dcnn', 'dsift', 'rdcnn', 'srdcnn', 'rcnnvd', 'dcnnvd', 'rdcnnvd'} ;
encoderList = {{rcnn}, {dcnn}, {dsift}, {rcnn dcnn}, {rcnn dcnn dsift}, {rcnnvd}, {dcnnvd}, {rcnnvd dcnnvd}} ;
datasetList = {{'kth', 4}, {'fmd',14}, {'dtd',10}, {'voc07',1}, {'mit',1}, {'os',1}} ;
for ii = 1 : numel(datasetList)
dataset = datasetList{ii} ;
if iscell(dataset)
numSplits = dataset{2} ;
dataset = dataset{1} ;
else
numSplits = 1 ;
end
for jj = 1 : numSplits
for ee = 1 : numel(encoderList)
os_train(...
'dataset', dataset, ...
'seed', jj, ...
'encoders', encoderList{ee}, ...
'prefix', 'exp02', ...
'suffix', setupNameList{ee}, ...
'printDatasetInfo', ee == 1, ...
'writeResults', true, ...
'vocDir', 'data/VOC2007', ...
'useGpu', true, ...
'gpuId', 1);
end
end
end
end