Mercurial > hg > smallbox
changeset 228:198d4d9cee74 luisf_dev
Now can use a local configuration file, which is a copy of the default config files, and thus not being commited to the repository.
author | luisf <luis.figueira@eecs.qmul.ac.uk> |
---|---|
date | Thu, 12 Apr 2012 15:06:41 +0100 |
parents | b50e2b6a9c37 |
children | ae71e160f80c |
files | config/SMALL_learn_config.m config/SMALL_solve_config.m util/SMALL_learn.m util/SMALL_solve.m |
diffstat | 4 files changed, 43 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- 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 <TolboxID> for your toolbox needs % to be defined and also prefferd API for toolbox functions <Preffered_API>
--- 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 <TolboxID> for your toolbox and % prefferd API <Preffered_API> needs to be defined.
--- 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
--- 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