# HG changeset patch # User luisf # Date 1334239601 -3600 # Node ID 198d4d9cee74a0ae433226ebc7bbce7210ea7d12 # Parent b50e2b6a9c377ea5d3f34779daa8e72fc1b0f4f3 Now can use a local configuration file, which is a copy of the default config files, and thus not being commited to the repository. diff -r b50e2b6a9c37 -r 198d4d9cee74 config/SMALL_learn_config.m --- a/config/SMALL_learn_config.m Thu Apr 12 14:06:27 2012 +0100 +++ b/config/SMALL_learn_config.m Thu Apr 12 15:06:41 2012 +0100 @@ -1,7 +1,10 @@ %% Configuration file used in SMALL_learn % -% Use this file to change the dictionary learning algorithms in SMALLBox -% Please refer to the documentation before editing this file +% Please DO NOT use this file to change the dictionary learning algorithms in SMALLBox +% If you want to change the dictionary learning algorithms +% create a copy of this file named 'SMALL_learn_config_local.m' +% +% Please refer to the documentation for further information % Centre for Digital Music, Queen Mary, University of London. % This file copyright 2009 Ivan Damnjanovic. @@ -73,7 +76,12 @@ DL.D(:,i)=DL.D(:,i)/norm(DL.D(:,i)); end D = DL.D; - + +%% +% Please do not make any changes to the 'SMALL_learn_config.m' file +% All the changes should be done to your local configuration file +% named 'SMALL_learn_config_local.m' +% % 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 diff -r b50e2b6a9c37 -r 198d4d9cee74 config/SMALL_solve_config.m --- a/config/SMALL_solve_config.m Thu Apr 12 14:06:27 2012 +0100 +++ b/config/SMALL_solve_config.m Thu Apr 12 15:06:41 2012 +0100 @@ -1,7 +1,10 @@ %% Configuration file used in SMALL_solve % -% Use this file to change the solvers in SMALLBox -% Please refer to the documentation before editing this file +% Please DO NOT use this file to change the solvers used in SMALLBox +% If you want to change the solvers create a copy +% of this file named 'SMALL_learn_config_local.m' +% +% Please refer to the documentation for further information % Centre for Digital Music, Queen Mary, University of London. % This file copyright 2009 Ivan Damnjanovic. @@ -14,6 +17,7 @@ % %% + if strcmpi(solver.toolbox,'sparselab') y = eval([solver.name,'(SparseLab_A, b, n,',solver.param,');']); elseif strcmpi(solver.toolbox,'sparsify') @@ -37,11 +41,11 @@ epsilon=solver.param.epsilon; maxatoms=solver.param.maxatoms; y = eval([solver.name,'(A, b, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); -% danieleb: added call to omp functions with fast implementation. + % danieleb: added call to omp functions with fast implementation. elseif (strcmpi(solver.toolbox, 'ompbox_fast')) DtX=A'*b; - XtX = sum(b.*b); - G=A'*A; + XtX = sum(b.*b); + G=A'*A; epsilon=solver.param.epsilon; maxatoms=solver.param.maxatoms; y = eval([solver.name,'(DtX, XtX, G,epsilon,''maxatoms'',maxatoms,''checkdict'',''off'');']); @@ -71,6 +75,11 @@ [y, cost] = wrapper_mm_solver(b, A, solver.param); + %% + % Please do not make any changes to the 'SMALL_solve_config.m' file + % All the changes should be done to your local configuration file + % named 'SMALL_solve_config_local.m' + % % To introduce new sparse representation algorithm put the files in % your Matlab path. Next, unique name for your toolbox and % prefferd API needs to be defined. diff -r b50e2b6a9c37 -r 198d4d9cee74 util/SMALL_learn.m --- a/util/SMALL_learn.m Thu Apr 12 14:06:27 2012 +0100 +++ b/util/SMALL_learn.m Thu Apr 12 15:06:41 2012 +0100 @@ -28,8 +28,16 @@ start=cputime; tStart=tic; -% toolboxes configuration file -run(fullfile(SMALL_path, 'config/SMALL_learn_config.m')); +%% toolbox configuration +% test if there is a locally modified version of the config +% otherwise reads the "default" config file +if exist(fullfile(SMALL_path, 'config/SMALL_learn_config_local.m'), 'file') == 2 + printf('\n\nSMALL_learn: Using local configuration file.\n\n'); + run(fullfile(SMALL_path, 'config/SMALL_learn_config_local.m')); +else + printf('\n\nSMALL_learn: Using default configuration file.\n\n'); + run(fullfile(SMALL_path, 'config/SMALL_learn_config.m')); +end %% % Dictionary Learning time diff -r b50e2b6a9c37 -r 198d4d9cee74 util/SMALL_solve.m --- a/util/SMALL_solve.m Thu Apr 12 14:06:27 2012 +0100 +++ b/util/SMALL_solve.m Thu Apr 12 15:06:41 2012 +0100 @@ -48,8 +48,14 @@ start=cputime; tStart=tic; -% solvers configuration file -run(fullfile(SMALL_path, 'config/SMALL_solve_config.m')); +%% solvers configuration +% test if there is a locally modified version of the config +% otherwise reads the "default" config file +if exist(fullfile(SMALL_path, 'config/SMALL_solve_config_local.m'), 'file') == 2 + run(fullfile(SMALL_path, 'config/SMALL_solve_config_local.m')); +else + run(fullfile(SMALL_path, 'config/SMALL_solve_config.m')); +end %% % Sparse representation time