-
Notifications
You must be signed in to change notification settings - Fork 2
/
experiments.m
88 lines (79 loc) · 2.47 KB
/
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
function experiments()
% EXPERIMENTS Run image classification experiments
% The experimens download a number of benchmark datasets in the
% 'data/' subfolder. Make sure that there are several GBs of
% space available.
%
% By default, experiments run with a lite option turned on. This
% quickly runs all of them on tiny subsets of the actual data.
% This is used only for testing; to run the actual experiments,
% set the lite variable to false.
%
% Running all the experiments is a slow process. Using parallel
% MATLAB and several corkes/machiens is suggested.
% Author: Andrea Vedaldi
% Copyright (C) 2013 Andrea Vedaldi
% All rights reserved.
%
% This file is part of the VLFeat library and is made available under
% the terms of the BSD license (see the COPYING file).
lite = false;
clear ex ;
if lite, tag = 'lite' ;
else, tag = 'ex' ; end
MDII_numTrain=3061;
MDII_numTest=3061;
trainType='rgb'
testType='thr'
% vlad
ex(1).prefix = 'vlad-aug' ;
ex(1).trainOpts = { 'C', 10} ;
ex(1).datasets = {'MDII'} ;
ex(1).seed = 1 ;
ex(1).opts = {...
'type', 'vlad', ...
'numWords', 1024, ...
'layouts', {'1x1'}, ...
'geometricExtension', 'xy', ...
'numPcaDimensions', 100, ...
'whitening', true, ...
'whiteningRegul', 0.01, ...
'renormalize', true, ...
'extractorFn', @(x) getDenseSIFT(x, ...
'step', 4, ...
'scales', 2.^(1:-.5:-3))};
% bovw
ex(2).prefix = 'bovw-aug' ;
ex(2).trainOpts = { 'C', 10} ;
ex(2).datasets = {'MDII'} ;
ex(2).seed = 1 ;
ex(2).opts = {...
'type', 'bovw', ...
'numWords', 1024, ...
'layouts', {'1x1'}, ...
'geometricExtension', 'xy', ...
'numPcaDimensions', 100, ...
'whitening', true, ...
'whiteningRegul', 0.01, ...
'renormalize', true, ...
'extractorFn', @(x) getDenseSIFT(x, ...
'step', 4, ...
'scales', 2.^(1:-.5:-3))};
for i=1:2
for j=1:numel(ex(i).datasets)
dataset = ex(i).datasets{j} ;
if ~isfield(ex(i), 'trainOpts') || ~iscell(ex(i).trainOpts)
ex(i).trainOpts = {} ;
end
traintestMDII(...
trainType, testType, ...
MDII_numTrain, MDII_numTest, ...
'prefix', [tag '-' dataset '-' ex(i).prefix], ...
'seed', ex(i).seed, ...
'dataset', char(dataset), ...
'datasetDir', fullfile('data', dataset), ...
'lite', lite, ...
ex(i).trainOpts{:}, ...
'encoderParams', ex(i).opts) ;
end
end