view config/SMALL_learn_config.m @ 195:d50f5bdbe14c luisf_dev

- Added SMALL_DL_test: simple DL showcase - Added dico_decorr_symmetric: improved version of INK-SVD decorrelation step - Debugged SMALL_learn, SMALLBoxInit and SMALL_two_step_DL
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Wed, 14 Mar 2012 14:42:52 +0000
parents 759313488e7b
children 751fa3bddd30
line wrap: on
line source


  if strcmpi(DL.toolbox,'KSVD')
    param=DL.param; 
    param.data=Problem.b;
 
    D = eval([DL.name,'(param)']);%, ''t'', 5);']);
  elseif strcmpi(DL.toolbox,'KSVDS')
    param=DL.param; 
    param.data=Problem.b;
    
    D = eval([DL.name,'(param, ''t'', 5);']);
  elseif strcmpi(DL.toolbox,'SPAMS')
    
    X  = Problem.b; 
    param=DL.param;
    
    D = eval([DL.name,'(X, param);']);
    %   As some versions of SPAMS does not produce unit norm column
    %   dictionaries, we need to make sure that columns are normalised to
    %   unit lenght.
    
    for i = 1: size(D,2)
        D(:,i)=D(:,i)/norm(D(:,i));
    end
  elseif strcmpi(DL.toolbox,'SMALL')
    
    X  = Problem.b; 
    param=DL.param;
    
    D = eval([DL.name,'(X, param);']);
    %   we need to make sure that columns are normalised to
    %   unit lenght.
    
    for i = 1: size(D,2)
        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>
%   
% elseif strcmpi(DL.toolbox,'<ToolboxID>')
%     % This is an example of API that can be used:
%     % - get training set from Problem part of structure
%     % - assign parameters defined in the main program
%
%     X  = Problem.b; 
%     param=DL.param;
%
%     % - Evaluate the function (DL.name - defined in the main) with
%     %   parameters given above
%
%     D = eval([DL.name,'(<Preffered_API>);']);

  else
    printf('\nToolbox has not been registered. Please change SMALL_learn file.\n');
    return
  end