Number of epoch equals number of loop iterations
4 次查看(过去 30 天)
显示 更早的评论
I am trying to train a neural network using for loop, 1 epoch at at time, and I want matlab to continue training with the weights and biases from the previous training. Is there any way to save the weights during the current iteration of the loop, and use them to initialize the neural network weights and biases in the next loop iteration ? (that is, I want the number of epochs to be the same as the number of iterations of the for loop ,say N, and call the training function N times)
Thank you in advance.
0 个评论
回答(2 个)
Chaitral Date
2017-4-24
I am not sure which function you are using to train the neural network. But below are some of the possible options that you can follow,
1) To save the weights and biases of the current iteration and to use them in future, you can always use functions "save" and "load".
2) You can also define the weights and biases as persistent variables and update them in every iteration.
Also, to get the weights and biases of a given network, you can use function "getwb".
I hope this helps!
0 个评论
Greg Heath
2017-4-25
It doesn't make any sense to record every weight after every epoch.
The net will automatically carry the last updated weights to the start of pthe next iteration.
Therefore, all you have to do is to assign 1 (unity) to the net property that defines the number of epochs to train.
Hope this helps.
Thank you for formally accepting my answer
Greg
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!