train_halfout_snn.m
来自「神经网络的工具箱, 神经网络的工具箱,」· M 代码 · 共 45 行
M
45 行
function [net, tr_info, dataset] = train_halfout_snn(net, data)%TRAIN_HALFOUT_SNN Train network on input data, dividing this data at % random in equal sized training and validation sets. % % Syntax%% [net, tr_info, dataset] = train_halfout_snn(net, wcf_data)%% Description%% TRAIN_HALFOUT_SNN takes% net - a net_struct with cost function WCF_SNN.% wcf_data - a wcfdata_struct containing the input data set.% and returns% net - a net_struct containing a network trained on% training and validation data, which are obtained by% bootstrapping on the input data set.% tr_info - a structure containing information about the% training process.% dataset - a structure with information about the subdivision% of input data in training and validation set.%% See also%% TRAIN_BOOTSTRAP_SNN%if strcmp(net.costFcn.name, 'wcf_snn') q = size(data.P,2); RP = randperm(q); ind_LV = RP([1:round(q/2)]); ind_VV = RP([round(q/2)+1:q]); dataLV = subset_wcfdata_snn(data, ind_LV); dataVV = subset_wcfdata_snn(data, ind_VV); dataset.trg_ind = ind_LV; dataset.val_ind = ind_VV; dataset.data = data; [net, tr_info] = train_snn(net, dataLV, dataVV);else errtext = sprintf(... 'TRAIN_HALFOUT_SNN: Do not know how to subdivide data for %s.', ... net.costFcn.name); error(errtext);end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?