Filter löschen
Filter löschen

How to "retrain" Neural Networks?

1 Ansicht (letzte 30 Tage)
Daniel
Daniel am 22 Nov. 2011
Hi,
I have an algorithm to forecast time series relying on observed values of the time series in the past. The algorithm is based on several so called experts and based on their performance in the past a convex combination of the experts is used for final prediction.
In the case of Neural Networks, one of the parameters of the experts is the amount of neurons h used. Simplified I have a loop
for i=1:n
net = newfit(inputs(:,1:i),targets(1:i),h);
net.divideParam.trainRatio=75/100;
net.divideParam.valRatio=25/100;
net.trainParam.showWindow=false;
net=train(net,inputs(:,1:i),targets(1:i));
estimate=sim(net,x_eval);
...
end
So in every iteration the network trained only difers a little bit, because only one pair of (inputs,targets) is added for training, the rest remains unchanged. Is there a way to use this fact and accelerate the whole process, like "retraining"?
Thanks
Daniel

Antworten (1)

Greg Heath
Greg Heath am 23 Nov. 2011
Everytime you call newfit you create a new network with random initial weights. Therefore, try something like
net = newfit(inputs,targets,h);
net.divideParam.trainRatio=75/100;
net.divideParam.valRatio=25/100;
net.trainParam.showWindow=false;
for i=1:n
net = train(net,inputs(:,1:i),targets(1:i));
estimate=sim(net,x_eval);
...
end
Hope this helps.
Greg
  1 Kommentar
Daniel
Daniel am 23 Nov. 2011
Hi Greg,
this should at least save some time for initiating, thank you. But the training process itself probably consumes a lot more time..
Daniel

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by