Mercurial > hg > smallbox
diff util/SMALL_learn.m @ 164:4205744092e6 release_1.9
Merge from branch "ivand_dev"
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Wed, 07 Sep 2011 14:17:30 +0100 |
parents | b14209313ba4 |
children | 7426503fc4d1 75b5dedcfd45 759313488e7b |
line wrap: on
line diff
--- a/util/SMALL_learn.m Tue Jul 26 16:02:59 2011 +0100 +++ b/util/SMALL_learn.m Wed Sep 07 14:17:30 2011 +0100 @@ -18,8 +18,9 @@ % License, or (at your option) any later version. See the file % COPYING included with this distribution for more information. %% - +if (DL.profile) fprintf('\nStarting Dictionary Learning %s... \n', DL.name); +end start=cputime; tStart=tic; if strcmpi(DL.toolbox,'KSVD') @@ -58,6 +59,30 @@ D(:,i)=D(:,i)/norm(D(:,i)); end + elseif strcmpi(DL.toolbox,'TwoStepDL') + + DL=SMALL_two_step_DL(Problem, DL); + + % we need to make sure that columns are normalised to + % unit lenght. + + for i = 1: size(DL.D,2) + DL.D(:,i)=DL.D(:,i)/norm(DL.D(:,i)); + end + D = DL.D; + +elseif strcmpi(DL.toolbox,'MMbox') + + DL = wrapper_mm_DL(Problem, DL); + + % we need to make sure that columns are normalised to + % unit lenght. + + for i = 1: size(DL.D,2) + DL.D(:,i)=DL.D(:,i)/norm(DL.D(:,i)); + end + D = DL.D; + % To introduce new dictionary learning technique put the files in % your Matlab path. Next, unique name <TolboxID> for your toolbox needs % to be defined and also prefferd API for toolbox functions <Preffered_API> @@ -83,9 +108,11 @@ %% % Dictionary Learning time tElapsed=toc(tStart); - DL.time = cputime - start; +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); +end DL.time=tElapsed; % If dictionary is given as a sparse matrix change it to full