Prev: How to generate multiple simulations in SIMULINK
Next: error with times, matrix dimensions must agree
From: Kadi on 22 Apr 2010 12:47 Can we use the 'train' command of the NN toolbox to train a neural network obtained from a PNN model, similar to the way we would train a network obtained from using newff? for example, let us say I have inputs and targets and I can use newpnn command to generate network parameters from the PNN model as follows P = [1 2 3 4 5 6 7]; Tc = [1 2 3 2 2 3 1]; T = ind2vec(Tc) net = newpnn(P,T); can this 'net' obtained as an output from newpnn be trained using the train command like net.trainFcn = 'trainbfg'; net.trainParam.epochs = 1000; net.trainParam.goal = 0.0001; net=train(net,P,T); I know we can train the net obtained from newff but when I tried training the net obtained from newpnn I am getting the following error msg ??? Error using ==> feval Invalid function name '' Error in ==> calcgx at 90 gX_direct = feval(net.performFcn,'dx',E,Y,net,perf,net.performParam); Error in ==> trainbfg at 320 gX = -calcgx(net,X,trainV.Pd,Zb,Zi,Zl,N,Ac,El,perf,Q,TS); Error in ==> network.train at 216 [net,tr] = feval(net.trainFcn,net,tr,trainV,valV,testV); Error in ==> net=train(net,P,T); I appreciate any kind of suggestions Thanks Kadambari
From: Greg Heath on 22 Apr 2010 15:03 On Apr 22, 12:47 pm, "Kadi " <n_kadamb...(a)yahoo.com> wrote: > Can we use the 'train' command of the NN toolbox to train a neural > network obtained from a PNN model, similar to the way we would > train a network obtained from using newff? No. Spreads have to be chosen by trial and error. If you wish to have fewer nodes than training vectors, use newrb. However, spreads still have to be chosen by trial and error. Search on greg heath RBFNN > for example, let oufrom the PNN model as follows > P = [1 2 3 4 5 6 7]; > Tc = [1 2 3 2 2 3 1]; > T = ind2vec(Tc) > net = newpnn(P,T); > > can this 'net' obtained as an output from newpnn be trained using the train command like > > net.trainFcn = 'trainbfg'; > net.trainParam.epochs = 1000; > net.trainParam.goal = 0.0001; > net=train(net,P,T); > > I know we can train the net obtained from newff but when I tried training the net obtained from newpnn I am getting the following error msg > > ??? Error using ==> feval > Invalid function name '' > > Error in ==> calcgx at 90 > gX_direct = feval(net.performFcn,'dx',E,Y,net,perf,net.performParam); > > Error in ==> trainbfg at 320 > gX = -calcgx(net,X,trainV.Pd,Zb,Zi,Zl,N,Ac,El,perf,Q,TS); > > Error in ==> network.train at 216 > [net,tr] = feval(net.trainFcn,net,tr,trainV,valV,testV); > > Error in ==> > net=train(net,P,T); > > I appreciate any kind of suggestions What, exactly, do you want the training agorithm to change? Greg
From: Kadi on 23 Apr 2010 15:04 Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. But I am not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn. Kadi
From: Greg Heath on 23 Apr 2010 15:30 On Apr 23, 3:04 pm, "Kadi " <n_kadamb...(a)yahoo.com> wrote: > Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. But I am > not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn. The only training that can be done on NEWPNN is to change the spread. There is no special function for that. Try NEWRB. It is better. However, it still has deficiencies. Search on greg heath RBFNN Hope this helps. Greg.
From: Kadi on 23 Apr 2010 15:51 Thanks for the immediate response. Just one more question. Is newrb better than newff? Thanks Kadi Greg Heath <heath(a)alumni.brown.edu> wrote in message <ac672c79-2db1-41ed-abf7-831246e9e9d3(a)g11g2000yqe.googlegroups.com>... > On Apr 23, 3:04 pm, "Kadi " <n_kadamb...(a)yahoo.com> wrote: > > Well, what I am actually trying to do is, I have input data (P) and the target class information (T). I built a pnn model using newpnn command of NN toolbox that uses the data and builds a neural network model. I used the entire data for validation and by trail and error found the spread value that gives the best classification. Then instead of using the entire data for training and validation I implemented crossvalidation. I am getting good results but when I used new unknown data that doesn't exactly match any of the samples in the training data, for validation the results were not good at all. And I told that the PNN is not really trained. The training set input vectors simply become the first layer weights and the second layer weights are set to the target vectors in the training set. So I tried to train the network obtained from the newpnn command using the train function. But I am > > not sure if we can use train command with newpnn because all of the examples that I have seen used newff instead of newpnn. > > The only training that can be done on NEWPNN is to > change the spread. There is no special function for that. > > Try NEWRB. It is better. However, it still has deficiencies. > Search on > > greg heath RBFNN > > Hope this helps. > > Greg.
|
Next
|
Last
Pages: 1 2 3 Prev: How to generate multiple simulations in SIMULINK Next: error with times, matrix dimensions must agree |