How can I solve the problem for this code related to retraining a neural network?
이전 댓글 표시
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.
댓글 수: 1
Greg Heath
2013년 10월 24일
편집: Greg Heath
2013년 10월 24일
Please repost using the {} (see the {} icons above the response boxes) to format your code
채택된 답변
추가 답변 (1개)
Greg Heath
2013년 10월 24일
You may be interested in my approach. I have several hundred examples in the NEWSREADER and ANSWERS.
Just use the search word
Ntrials
I use fitnet for regression and patternet for classification
Ntrials fitnet
I don't think I posted any using the house_dataset.
댓글 수: 2
Greg Heath
2013년 10월 25일
Two corrections:
NMSE = mean(variance(error',1)/ mean(variance(target',1))
Rsquared = 1 - NMSE.
Mohamad
2013년 11월 2일
카테고리
도움말 센터 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!