diff DL/two-step DL/SMALL_two_step_DL.m @ 198:83af80baf959 luisf_dev

Reverted SMALL_two_step to the original version; adds path in the Init script.
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 20 Mar 2012 12:29:47 +0000
parents d50f5bdbe14c
children dfa795944aae
line wrap: on
line diff
--- a/DL/two-step DL/SMALL_two_step_DL.m	Tue Mar 20 10:40:59 2012 +0000
+++ b/DL/two-step DL/SMALL_two_step_DL.m	Tue Mar 20 12:29:47 2012 +0000
@@ -30,8 +30,7 @@
 
 % initialize the dictionary %
 
-% todo: check second if statement
-if (isfield(DL.param,'initdict')) && ~isempty(DL.param.initdict);
+if (isfield(DL.param,'initdict'))
   if (any(size(DL.param.initdict)==1) && all(iswhole(DL.param.initdict(:))))
     dico = sig(:,DL.param.initdict(1:dictsize));
   else
@@ -98,7 +97,6 @@
 % want sparse representation of training set, and in Problem.b1 in this
 % version of software we store the signal that needs to be represented
 % (for example the whole image)
-global SMALL_path
 
 tmpTraining = Problem.b1;
 Problem.b1 = sig;
@@ -112,15 +110,11 @@
 for i = 1:iternum
     Problem.A = dico;
     solver = SMALL_solve(Problem, solver);
-    
-    % configuration file
-    run([SMALL_path '/config/SMALL_two_step_DL_config.m'])
-   
-%     [dico, solver.solution] = dico_update(dico, sig, solver.solution, ...
-%         typeUpdate, flow, learningRate);
-%     if (decorrelate)
-%         dico = dico_decorr(dico, mu, solver.solution);
-%     end
+    [dico, solver.solution] = dico_update(dico, sig, solver.solution, ...
+        typeUpdate, flow, learningRate);
+    if (decorrelate)
+        dico = dico_decorr(dico, mu, solver.solution);
+    end
     
    if ((show_dictionary)&&(mod(i,show_iter)==0))
        dictimg = SMALL_showdict(dico,[8 8],...
@@ -145,4 +139,4 @@
   Y(blockids) = sum(X(:,blockids).^2);
 end
 
-end
+end
\ No newline at end of file