annotate util/SMALL_learn.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 751fa3bddd30
rev   line source
idamnjanovic@8 1 function DL = SMALL_learn(Problem,DL)
ivan@121 2 %% SMALL Dictionary Learning
ivan@121 3 %
ivan@121 4 % Function gets as input Problem and Dictionary Learning (DL) structures
ivan@121 5 % In Problem structure field b with the training set needs to be defined
ivan@121 6 % In DL fields with name of the toolbox and solver, and parameters file
ivan@121 7 % for particular dictionary learning technique needs to be present.
ivan@121 8 %
ivan@121 9 % Outputs are Learned dictionary and time spent as a part of DL structure
ivan@121 10
idamnjanovic@24 11 %
idamnjanovic@24 12 % Centre for Digital Music, Queen Mary, University of London.
idamnjanovic@24 13 % This file copyright 2009 Ivan Damnjanovic.
idamnjanovic@24 14 %
idamnjanovic@24 15 % This program is free software; you can redistribute it and/or
idamnjanovic@24 16 % modify it under the terms of the GNU General Public License as
idamnjanovic@24 17 % published by the Free Software Foundation; either version 2 of the
idamnjanovic@24 18 % License, or (at your option) any later version. See the file
idamnjanovic@24 19 % COPYING included with this distribution for more information.
idamnjanovic@8 20 %%
daniele@195 21 global SMALL_path
ivan@152 22 if (DL.profile)
idamnjanovic@8 23 fprintf('\nStarting Dictionary Learning %s... \n', DL.name);
ivan@152 24 end
idamnjanovic@8 25 start=cputime;
idamnjanovic@36 26 tStart=tic;
idamnjanovic@8 27
luis@190 28 % configuration file
luis@198 29 run(fullfile(SMALL_path, 'config/SMALL_learn_config.m'));
idamnjanovic@8 30
idamnjanovic@8 31 %%
idamnjanovic@8 32 % Dictionary Learning time
idamnjanovic@36 33 tElapsed=toc(tStart);
ivan@152 34 DL.time = cputime - start;
ivan@152 35 if (DL.profile)
maria@86 36 fprintf('\n%s finished task in %2f seconds (cpu time). \n', DL.name, DL.time);
maria@86 37 fprintf('\n%s finished task in %2f seconds (tic-toc time). \n', DL.name, tElapsed);
ivan@152 38 end
idamnjanovic@36 39 DL.time=tElapsed;
idamnjanovic@8 40 % If dictionary is given as a sparse matrix change it to full
idamnjanovic@8 41
idamnjanovic@8 42 DL.D = full(D);
idamnjanovic@8 43
idamnjanovic@8 44 end
daniele@195 45