CALC_HYPERPARAMETER: calculate hyperparameter value The hyperparameter is can be either provided directly, or can be based an automatic selection approach calc_hyperparameter can be called as hyperparameter= calc_hyperparameter( inv_model ) where inv_model is an inv_model structure if inv_model.hyperparameter.func exists, it will be called, otherwise inv_model.hyperparameter.value will be returned TODO: does hyperparameter depend on inv_model, or does it also depend on the data?
0001 function hyperparameter = calc_hyperparameter( inv_model ) 0002 % CALC_HYPERPARAMETER: calculate hyperparameter value 0003 % The hyperparameter is can be either provided directly, 0004 % or can be based an automatic selection approach 0005 % 0006 % calc_hyperparameter can be called as 0007 % hyperparameter= calc_hyperparameter( inv_model ) 0008 % where inv_model is an inv_model structure 0009 % 0010 % if inv_model.hyperparameter.func exists, it will be 0011 % called, otherwise inv_model.hyperparameter.value will 0012 % be returned 0013 % 0014 % TODO: does hyperparameter depend on inv_model, or does 0015 % it also depend on the data? 0016 0017 % (C) 2005 Andy Adler. License: GPL version 2 or version 3 0018 % $Id: calc_hyperparameter.html 2819 2011-09-07 16:43:11Z aadler $ 0019 0020 if isfield( inv_model.hyperparameter, 'func') 0021 0022 hyperparameter = eidors_obj('get-cache', inv_model, 'hyperparameter'); 0023 if ~isempty(hyperparameter) 0024 eidors_msg('calc_hyperparameter: using cached value', 2); 0025 return 0026 end 0027 0028 hyperparameter= feval( inv_model.hyperparameter.func, inv_model); 0029 0030 eidors_obj('set-cache', inv_model, 'hyperparameter', hyperparameter); 0031 eidors_msg('calc_hyperparameter: setting cached value', 2); 0032 0033 else 0034 hyperparameter= inv_model.hyperparameter.value; 0035 end