diff util/SMALL_learn.m @ 199:751fa3bddd30 luisf_dev

Added config file for SMALL_solve (removed the if/else code from SMALL_solve); added headers to both config files;
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Tue, 20 Mar 2012 14:28:51 +0000
parents 83af80baf959
children f3b6ddd2f04f
line wrap: on
line diff
--- a/util/SMALL_learn.m	Tue Mar 20 12:29:47 2012 +0000
+++ b/util/SMALL_learn.m	Tue Mar 20 14:28:51 2012 +0000
@@ -1,9 +1,9 @@
 function DL = SMALL_learn(Problem,DL)
-%% SMALL Dictionary Learning   
-%   
-%   Function gets as input Problem and Dictionary Learning (DL) structures 
+%% SMALL Dictionary Learning
+%
+%   Function gets as input Problem and Dictionary Learning (DL) structures
 %   In Problem structure field b with the training set needs to be defined
-%   In DL fields with name of the toolbox and solver, and parameters file 
+%   In DL fields with name of the toolbox and solver, and parameters file
 %   for particular dictionary learning technique needs to be present.
 %
 %   Outputs are Learned dictionary and time spent as a part of DL structure
@@ -18,28 +18,31 @@
 %   License, or (at your option) any later version.  See the file
 %   COPYING included with this distribution for more information.
 %%
+
 global SMALL_path
+
 if (DL.profile)
-  fprintf('\nStarting Dictionary Learning %s... \n', DL.name);
+    fprintf('\nStarting Dictionary Learning %s... \n', DL.name);
 end
-  start=cputime;
-  tStart=tic;
-    
-  % configuration file
-  run(fullfile(SMALL_path, 'config/SMALL_learn_config.m'));
-    
+
+start=cputime;
+tStart=tic;
+
+% toolboxes configuration file
+run(fullfile(SMALL_path, 'config/SMALL_learn_config.m'));
+
 %%
 %   Dictionary Learning time
 tElapsed=toc(tStart);
 DL.time = cputime - start;
 if (DL.profile)
-  fprintf('\n%s finished task in %2f seconds (cpu time). \n', DL.name, DL.time);
-  fprintf('\n%s finished task in %2f seconds (tic-toc time). \n', DL.name, tElapsed);
+    fprintf('\n%s finished task in %2f seconds (cpu time). \n', DL.name, DL.time);
+    fprintf('\n%s finished task in %2f seconds (tic-toc time). \n', DL.name, tElapsed);
 end
 DL.time=tElapsed;
-%   If dictionary is given as a sparse matrix change it to full  
+%   If dictionary is given as a sparse matrix change it to full
 
-  DL.D = full(D);
-  
+DL.D = full(D);
+
 end
-  
+