Can a user-defined function be called after weight/bias updates during training?

Hello.
I was wondering if there's a way to specify a function to be executed after weight/bias updates when calling train() or adapt()?
My current solution is to call train multiple times with net.trainParam.epochs=1, but this appears to negatively impact learning.
Thanks
-- Jeff

댓글 수: 2

What is this function supposed todo?
Hi Greg. Well, I would like to track the weights as they update, and I would also like to modify some of them myself along the way. I'm currently just running train with trainParam.epochs=1 to do so, but as we've chatted about, this can shoot the learning alg in the foot.
Thanks again.

댓글을 달려면 로그인하십시오.

 채택된 답변

Greg Heath
Greg Heath 2012년 11월 13일
In a recent post originated by Jason, I've shown that interrupted training using net.trainParam.epochs = 1 without a validation set can yield the same weights as continued training. However, it may take much longer. How much longer will be different for different problems.
WB(:,i) = getwb(net);
Is sufficient for saving the weights of the ith epoch.
Hope this helps.
Thank you for formally accepting my answer.
Greg

댓글 수: 1

hi greg, im using r2008a, i cant find the getwb function. does it only offer using newer version?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

The reason the stopping/starting negatively impacts learning is because the learning parameters are reinitialized every time train is called. Even if you obtain the final parameters from
net.trainParam: .showWindow, .showCommandLine, .show, .epochs,
.time, .goal, .min_grad, .max_fail, .mu, .mu_dec,
.mu_inc, .mu_max
and/or
tr: .mu, .gradient, .val_fail, etc
there is no way to use them to initialize the next call of train unless the function is modified.
Perhaps that will be available in a new version. (I've suggested that to the TBX author.)
Hope this helps.
Thank you for formally accepting my answer.
Greg

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by