From: Jorge Pasquotto on
I am trying to learn how to forecast time series using Elman
networks.
I dont understant what happens with the following code, because the
validation and test data seems to be not considered by Matlab
(2008a).
The MSE performance, for example, is calculated for the entire set
of data...instead of only taking the first 7 inputs for training.
Please see the code:
% function Y = f(X) = 3X+1
P={1 2 3 4 5 6 7 8 9 10};
T={4 7 10 13 16 19 22 25 28 31};
S1=2;
% create an Elman 1-2-1 network
net=newelm(P,T,S1);
% correct bug in the version 2008a (calcjxfp => calcgbtt)
net.gradientFcn='calcgbtt'; %
% partition of data set seems to be not working!!!???
trainInd=(1:7);
valInd=(8:9);
testInd=(10);
net.divideFcn='divideInd';
% set maximum number of epochs (I've tried till 50 000)
net.trainParam.epochs = 600;
% train the network
net = train(net,P,T);

> in this moment matlab shows nntraintool and I can only see (plot performance) a chart
with a blue MSE line regarding training data.
I would expect to seem two lines more: a red one regarding test set, and a green
one regarding validation.

why it does not work (cross-validation)?
Appreciate your help!!

JP
 | 
Pages: 1
Prev: matlab code
Next: programming robot using matlab