Mercurial > hg > smallbox
changeset 126:db5a7fe1a404 ivand_dev
Merge from branch "sup_158_IMG_Processing_toolbox_"
author | Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk> |
---|---|
date | Wed, 25 May 2011 15:30:34 +0100 |
parents | 5ded5e2e7d07 (diff) 002ec1b2ceff (current diff) |
children | 6f78b069e541 8e660fd14774 |
files | util/ssim_index.m util/vmrse_type2.m |
diffstat | 1 files changed, 10 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/util/SMALL_learn.m Wed May 25 15:29:20 2011 +0100 +++ b/util/SMALL_learn.m Wed May 25 15:30:34 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 <TolboxID> for your toolbox needs % to be defined and also prefferd API for toolbox functions <Preffered_API>