train neural net with prior solution

Antworten (1)

Matt J
Matt J am 28 Nov. 2024
Bearbeitet: Matt J am 28 Nov. 2024

0 Stimmen

Your post is under-detailed and does not tell us how the network and training are implemented. If I assume you are using trainnet, e.g.,
you can simply run the training again, giving as the second input argument your pre-existing, partially trained network.

4 Kommentare

Dilip
Dilip am 28 Nov. 2024
Verschoben: Matt J am 28 Nov. 2024
I ran a two layer neural net with 50 neurons at each layer using
mdl=train(net,X,Y)
X and Y were 2000 by 4.
The training stopped on maximum epochs reached that was 10000.
Would now like to start where it finished. Performance of mse was 0.007 target is 0.0005. It took some 6 hours.
Thanks.
Matt J
Matt J am 28 Nov. 2024
Bearbeitet: Matt J am 28 Nov. 2024
Similary, train() can be given a previously trained net as its first input,
mdl=train(netPrevious,X,Y)
and the training will resume using the weights contained in netPrevious.
See also Train Network Using Checkpoint Saves,
Dilip
Dilip am 28 Nov. 2024
When I do this the initial Performance is much larger than the final Performance of the previous net. Is this a concern or should one not worry about this. Many Thanks.
Matt J
Matt J am 28 Nov. 2024
Bearbeitet: Matt J am 28 Nov. 2024
This method of resuming training is not optimal. The optimal method is using checkpoint saves, as explained at the link I gave you. But since you did not set checkpoints, the training algorithm does not have everything it needs to resume gracefully.
Even though you have the network weights and biases, there is no record of prior algorithm state variables, like learning rate schedules and momentum, etc... Therefore, the algorithm will need time to reconverge. You still might end up saving iterative effort as compared to starting from scratch, but next time you should use checkpoints. Or, consider moving to the Deep Learning Toolbox, which does give you finer control of algorithm variables.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 28 Nov. 2024

Bearbeitet:

am 28 Nov. 2024

Community Treasure Hunt

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

Start Hunting!

Translated by