# HG changeset patch # User Ivan Damnjanovic lnx # Date 1306326827 -3600 # Node ID 5ded5e2e7d07c814ad0fa49b1c3615cdb955dc44 # Parent 850e90bbf4b0f84cf5da9fb8639cee77b45c2e9c bug 159 Removed API for Skretting/Engang rlsdla diff -r 850e90bbf4b0 -r 5ded5e2e7d07 util/SMALL_learn.m --- a/util/SMALL_learn.m Mon May 23 12:34:00 2011 +0100 +++ b/util/SMALL_learn.m Wed May 25 13:33:47 2011 +0100 @@ -1,5 +1,13 @@ function DL = SMALL_learn(Problem,DL) -%%% SMALL Dictionary Learning +%% 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 +% for particular dictionary learning technique needs to be present. +% +% Outputs are Learned dictionary and time spent as a part of DL structure + % % Centre for Digital Music, Queen Mary, University of London. % This file copyright 2009 Ivan Damnjanovic. @@ -9,13 +17,6 @@ % published by the Free Software Foundation; either version 2 of the % License, or (at your option) any later version. See the file % COPYING included with this distribution for more information. -% -% 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 -% for particular dictionary learning technique needs to be present. -% -% Outputs are Learned dictionary and time spent as a part of DL structure %% fprintf('\nStarting Dictionary Learning %s... \n', DL.name); @@ -56,19 +57,7 @@ for i = 1: size(D,2) D(:,i)=D(:,i)/norm(D(:,i)); end - elseif strcmpi(DL.toolbox,'mpv2') - X = Problem.b(:,1:1:40000); - jD0 = mpv2.SimpleMatrix(DL.param.D); - jDicLea = mpv2.DictionaryLearning(jD0, 1,1); -% !!!!! MAYBE lambda is not needed for ILS - NEED TO CHECK!!!! - jDicLea.setLambda('L', DL.param.lambda, DL.param.lambda, 1000); - jDicLea.setVerbose(2); - jDicLea.setORMP(16, 1e-6, DL.param.abs); - eval(['jDicLea.',DL.name,'( X(:), DL.param.iternum );']); - jD = jDicLea.getDictionary(); - - D = reshape(jD.getAll(), size(X,1), DL.param.K); - + % To introduce new dictionary learning technique put the files in % your Matlab path. Next, unique name for your toolbox needs % to be defined and also prefferd API for toolbox functions