comparison config/SMALL_learn_config.m @ 190:759313488e7b luisf_dev

Added two config files for the 2 step dic and learn scripts; removed 'extra' folder; created init script (initial version).
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 13 Mar 2012 17:33:20 +0000
parents
children 751fa3bddd30
comparison
equal deleted inserted replaced
187:3cc204120431 190:759313488e7b
1
2
3 if strcmpi(DL.toolbox,'KSVD')
4 param=DL.param;
5 param.data=Problem.b;
6
7 D = eval([DL.name,'(param)']);%, ''t'', 5);']);
8 elseif strcmpi(DL.toolbox,'KSVDS')
9 param=DL.param;
10 param.data=Problem.b;
11
12 D = eval([DL.name,'(param, ''t'', 5);']);
13 elseif strcmpi(DL.toolbox,'SPAMS')
14
15 X = Problem.b;
16 param=DL.param;
17
18 D = eval([DL.name,'(X, param);']);
19 % As some versions of SPAMS does not produce unit norm column
20 % dictionaries, we need to make sure that columns are normalised to
21 % unit lenght.
22
23 for i = 1: size(D,2)
24 D(:,i)=D(:,i)/norm(D(:,i));
25 end
26 elseif strcmpi(DL.toolbox,'SMALL')
27
28 X = Problem.b;
29 param=DL.param;
30
31 D = eval([DL.name,'(X, param);']);
32 % we need to make sure that columns are normalised to
33 % unit lenght.
34
35 for i = 1: size(D,2)
36 D(:,i)=D(:,i)/norm(D(:,i));
37 end
38
39 elseif strcmpi(DL.toolbox,'TwoStepDL')
40
41 DL=SMALL_two_step_DL(Problem, DL);
42
43 % we need to make sure that columns are normalised to
44 % unit lenght.
45
46 for i = 1: size(DL.D,2)
47 DL.D(:,i)=DL.D(:,i)/norm(DL.D(:,i));
48 end
49 D = DL.D;
50
51 elseif strcmpi(DL.toolbox,'MMbox')
52
53 DL = wrapper_mm_DL(Problem, DL);
54
55 % we need to make sure that columns are normalised to
56 % unit lenght.
57
58 for i = 1: size(DL.D,2)
59 DL.D(:,i)=DL.D(:,i)/norm(DL.D(:,i));
60 end
61 D = DL.D;
62
63 % To introduce new dictionary learning technique put the files in
64 % your Matlab path. Next, unique name <TolboxID> for your toolbox needs
65 % to be defined and also prefferd API for toolbox functions <Preffered_API>
66 %
67 % elseif strcmpi(DL.toolbox,'<ToolboxID>')
68 % % This is an example of API that can be used:
69 % % - get training set from Problem part of structure
70 % % - assign parameters defined in the main program
71 %
72 % X = Problem.b;
73 % param=DL.param;
74 %
75 % % - Evaluate the function (DL.name - defined in the main) with
76 % % parameters given above
77 %
78 % D = eval([DL.name,'(<Preffered_API>);']);
79
80 else
81 printf('\nToolbox has not been registered. Please change SMALL_learn file.\n');
82 return
83 end