Hello I have a question regarding "Neural Network Toolbox User's Guide R2013b". In this document, there are some suggested algorithms to improve generalization in which the first one is retraining neural network. In this document on page 8-36 the program is as follows: [x,t] = house_dataset; Q = size(x,2); Q1 = floor(Q*0.90); Q2 = Q-Q1; ind = randperm(Q); ind1 = ind(1:Q1); ind2 = ind(Q1+(1:Q2)); x1 = x(:,ind1); t1 = t(:,ind1); x2 = x(:,ind2); t2 = t(:,ind2); net = feedforwardnet(10); numNN = 10; NN = cell(1,numNN); perfs = zeros(1,numNN); for i=1:numNN disp(['Training ' num2str(i) '/' num2str(numNN)]) NN{i} = train(net,x1,t1); y2 = NN{i}(x2); perfs(i) = mse(net,t2,y2); end
I have problem with this part of program y2 = NN{i}(x2);. When I run this part of the program Matlab shows this error: ??? Error using ==> network.subsref at 83 Subscript indices must either be real positive integers or logical
It seems as if we want to use cell array indexing, if so, we must use indices in parenthesis instead of x2 which is 10% part of house_dataset. Am I correct in this field? if not, how can I obviate this problem to correct this code? 2. Why do not we use matlab simulation after training the network on the first part of the data set? for instance : y=sim(net,x2,t2) and then calling the performance function. 3. When we use feedforwardnet the data set are automatically divided into three parts. Should we disable this with net. divideFcn="" before running this code? Your kind help is greatly appreciated.
Best Answer