From: Jorge Pasquotto on
Dear,all
What about recurrent networks and time series?
If I have a dataset which refers to a time serie.
How can I set training,validation and test data when I am using newelm, backpropagation (traingdx) and "calcbtt" ?
I have presented data as a matriz [p1j], then converted to a sequency via command "con2seq" but doing this way, matlab disregard any validation/test set.
Training is done with the entire set.
Appreciate your help.
Regards
JP


Greg Heath <heath(a)alumni.brown.edu> wrote in message <20c3e73d-02f5-43b8-ae0f-f1adaafaeead(a)r13g2000vbr.googlegroups.com>...
>
> On Jun 3, 11:48 pm, Tony <tanaby.zibamanzar.mof...(a)gmail.com> wrote:
> > Hello all,
> >
> > I want to use early stopping in my 10-fold cross validation neural net
> > training.
> > I'm using newff along with train functions to create and train the NN.
> >
> > As far as I know, train function divides the dataset into tr/val/tst
> > sets automatically.
>
> It depends on what is specified in the DDF input of NEWFF.
>
> > how can I set "train" function to use my
> > designated folds (8-1-1) for tr/val/tst?
>
> What version do you have? The commands for the 2009a version
> of TRAIN is
>
> [net, tr, Y, E, Pf, Af] = train( net, P, T, Pi, Ai )
>
> which, for some god-forsaken reason, contains no reference to data
> division.
>
> On the other hand, the command for the 2009a version of TRAINLM is
>
> [net,TR] = trainlm(net,TR,trainV,valV,testV)
>
> So I guess MATLAB thinks that the following makes sense:
>
> net = newff( P, T, [ S1 S2...S(N-1) ], { TF1 TF2...TFN }, ...
> BTF, BLF, PF, IPF, OPF, DDF)
>
> 1. In NEWFF override the default for DDF to get the 8/1/1 split but
> use
> the default for BTF to use TRAINLM.
> 2. Then TRAIN will call the default TRAINLM which will obtain the
> divide
> information from the override specification of DDF in NEWFF.
>
> YIKES!
>
> > I have used net.divideParam.trainRatio=0.8889;
> > net.divideParam.valRatio=0.1111;
> > and net.divideParam.testRatio=0; meaning 1/9(folds) =0.11 % of
> > data are used for validation and 1-0.11=0.89% are used for training.
> > Is there a better way to do that?
>
> What about
>
> net.divideParam.trainRatio = 0.8;
> net.divideParam.valRatio = 0.1;
> net.divideParam.testRatio = 0.1;
>
> > here is some parts of my code:
> > indices=crossvalind('kfold',Tar,10);
> > for i=1:10
> > test=(indices==i);trains= ~test;
>
> BZZT. TRAINS is a MATLAB function. Use another name.
> What happened to val?
>
> Why not something like
>
> tst = (indices==i);
> val = (indices== mod(i+1,10));
> trn = ~[tst,val];
>
> > net=newff(P1(:,trains),Tar(:,trains),4);
> > net=init(net);
>
> Init not needed. Initialization is automatic.
>
> > net.divideParam.trainRatio=0.8889;
> > net.divideParam.valRatio=0.1111;
> > net.divideParam.testRatio=0;
>
> Why not override DDF in the call of NEWFF?
>
> > [net,tr]=train(net,P1(:,trains),Tar(:,trains));
> > out = round(sim(net,P(:,test)));
> >
> > %%% evaluate performance......
> > end
> >
> > I appreciate your help and comments...
>
> The new code is so convoluted, it is impossible to understand how
> to do this without trial and error. If I had to use the 2009a
> version
> I would try to use TRAINLM directly instead of TRAIN.
>
> Hope this helps.
>
> Greg
 | 
Pages: 1
Prev: File browser in matlab GUI
Next: rtw_c error