Number of epoch equals number of loop iterations
조회 수: 1 (최근 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!