unbiased_average_snn.m

来自「神经网络的工具箱, 神经网络的工具箱,」· M 代码 · 共 45 行

M
45
字号
function y_validation = unbiased_average_snn(nets, alpha, datasets)%UNBIASED_AVERAGE_SNN Unbiased weighted average.%% Syntax%%  y_uav = unbiased_average_snn(nets, alpha, datasets)%% Description%%  UNBIASED_AVERAGE_SNN computes an unbiased weigthed average output%  for the ensemble of 'nets', i.e. for each pattern the averaging is%  only over the networks in the ensemble which did not use that%  pattern in training.   %%  UNBIASED_AVERAGE_SNN(nets, alpha, datasets) takes%    nets       - [1 x M] matrix of net_structs trained with %                 costFcn = wcf_snn.%    alpha      - [1 x M] matrix of network weighting factors. %    datasets   - [1 x M] matrix of dataset_structs containing%                 information on the data used in training 'nets'. %  and returns%    y_uav      - unbiased average.% data = datasets(1).data;M = size(nets, 2);N = size(nets(1).biases{nets(1).numLayers},1);[NI, MU] = size(data.P);errf = nets(1).costFcn.fn;ym = zeros(N, MU, M);q = sparse(MU, M);for m = 1:M    ym(:,:,m) = simff_snn(nets(1,m), data);    % q(mu, m) is 1 if pattern mu is in the validation set of network m    q(datasets(m).val_ind, m) = 1;    endfor mu = 1:MU    m = find(q(MU,:));     y_validation(:, mu) =  average_outputs_snn(ym(:,mu,m), alpha(m), errf);end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?