============================================================== FIND_GENERALISABILITY: Find the generalisability of a model. Code written by Katherine Smith, 2003 GENERAL [mean_generalisability, std_generalisability] = find_generalisability(model, n_iterations, verbose) INPUT/S -model: The model for which generalisability is calculated. -n_iteration: Number of iterations to control the complexity of this function? -verbose: Verbose flag. OUTPUT/S -mean_generalisability: The mean generalisability. -mean_generalisability: The standard deviation (?) of the generalisability values? PENDING WORK -Resolve meaning of inputs and outputs. -Add more comments to code. KNOWN BUG/S -None. COMMENT/S -Smith: Attempt to reconstruct an unseen example and measure distance from the example (mean squared difference). RELATED FUNCTION/S FIND_SPECIFICITY ABOUT -Created: November 23rd, 2003 -Last update: Novermber 25th, 2003 -Revision: 0.0.2 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function [mean_generalisability, std_generalisability] = find_generalisability(model, n_iterations, verbose) 0002 % ============================================================== 0003 % FIND_GENERALISABILITY: Find the generalisability of a model. 0004 % 0005 % Code written by Katherine Smith, 2003 0006 % 0007 % GENERAL 0008 % 0009 % [mean_generalisability, std_generalisability] = 0010 % find_generalisability(model, n_iterations, verbose) 0011 % 0012 % INPUT/S 0013 % 0014 % 0015 % -model: 0016 % The model for which generalisability is calculated. 0017 % 0018 % -n_iteration: 0019 % Number of iterations to control the complexity of 0020 % this function? 0021 % 0022 % -verbose: 0023 % Verbose flag. 0024 % 0025 % OUTPUT/S 0026 % 0027 % -mean_generalisability: 0028 % The mean generalisability. 0029 % 0030 % -mean_generalisability: 0031 % The standard deviation (?) of the generalisability values? 0032 % 0033 % PENDING WORK 0034 % 0035 % -Resolve meaning of inputs and outputs. 0036 % -Add more comments to code. 0037 % 0038 % KNOWN BUG/S 0039 % 0040 % -None. 0041 % 0042 % COMMENT/S 0043 % 0044 % -Smith: Attempt to reconstruct an unseen example 0045 % and measure distance from the example 0046 % (mean squared difference). 0047 % 0048 % RELATED FUNCTION/S 0049 % 0050 % FIND_SPECIFICITY 0051 % 0052 % ABOUT 0053 % 0054 % -Created: November 23rd, 2003 0055 % -Last update: Novermber 25th, 2003 0056 % -Revision: 0.0.2 0057 % -Author: R. S. Schestowitz, University of Manchester 0058 % ============================================================== 0059 0060 % search parameters with simplex 0061 % hack in white width for now 0062 0063 verbose='off'; 0064 % RSS, added 8th December 2003 to get eval_1d_app_model_obj_fn to run 0065 0066 white_width = 0.2; 0067 %subs = figure; 0068 for i=1:n_iterations 0069 [imagelist,example,points, his, los] = make_1d_images(1, size(model.intensity_model.pcs(:,1),1), white_width); 0070 [params, scores(i)] = fminsearch(@eval_msd,zeros(1,size(model.params,2)),optimset('Display',verbose,'TolX',0.001,'TolFun',0.001),model,example); 0071 % scores(i) 0072 % difference_image = abs(example - construct_model_example(params, model, 1:50)); 0073 % figure(subs),hold on,subplot(5,1,i),plot(difference_image),gca,title(['score: ' num2str(scores(i))]); 0074 end 0075 mean_generalisability = mean(scores); 0076 std_generalisability = std(scores);