Number of epoch equals number of loop iterations

5 visualizaciones (últimos 30 días)
Salman Habib
Salman Habib el 8 de Abr. de 2017
Respondida: Greg Heath el 25 de Abr. de 2017
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.

Respuestas (2)

Chaitral Date
Chaitral Date el 24 de Abr. de 2017
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!

Greg Heath
Greg Heath el 25 de Abr. de 2017
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

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by