我的问题与this one有关。在我的分类任务中,我想用11个索引来测试网络,但是我想进行很多分类,我需要Matlab随机决定使用哪些向量进行训练和验证,就像在NNSTART中启动的GUI一样。 这可能吗?
如何更改以下代码?
net.divideFcn = 'divideind';
net.divideParam.trainInd=1:102; % The first 127 vectors are for training.
net.dividnet.divideParam.valInd=103:127; % The next 25 vectors are for validation.
net.divideParam.testInd=128:138; % The last 11 vectors are for testing the network.
答案 0 :(得分:0)
我猜你可以随机分配这些数字。
类似的东西:
indx=103:138;
rand_indx=indx(randperm(length(indx))); % reorder them randomly
net.dividnet.divideParam.valInd=rand_indx(1:25); % The next 25 vectors are for validation.
net.divideParam.testInd=rand_indx(26:end); % The last 11 vectors are for testing the network.