How can I pause and resume Sequence-to-Sequence Classification Using Deep Learning

1 次查看(过去 30 天)
Hi there,
I have been learing how to train the Sequence-to-Sequence Classification Using Deep Learning
https://uk.mathworks.com/help/deeplearning/ug/sequence-to-sequence-classification-using-deep-learning.html
  1. My question is, how can I pause and train them again? I used to try the checkpoint but am not sure if that is the correct solution.
  2. Is it possible to train the existing net with other datasets?
Thank you

回答(1 个)

Milan Bansal
Milan Bansal 2023-9-15
Hi,
As per my understanding, you want to pause the training of the Neural Network and resume it later again. Also, you want to train the existing trained network on some other dataset.
1.) You can stop the training of the Neural Network in the "training progress" dialogue box.
  • Click on the button present on the right side of the progress bar in the "training progress" dialogue box. This will stop the trianing and save the current progress.
  • Save the trained network as ".mat file "using "save" command.
save('trainedNetwork.mat', 'net');
  • Load the saved network.
net = load('trainedNetwork.mat');
  • Begin the training again by using the saved network as initial weights. This can be achieved by setting the "layers" argument of the "trainNetwork" function as "net.Layers"
net = trainNetwork(XTrain,YTrain,net.Layers,options);
2.) It is possible to train the existing network with other data sets. This can be achieved by taking the existing network as initial weights and training the network with new data. Follow the below steps.
  • Load the existing network.
  • Set the "layers" argument of the "trainNetwork" function as "saveNet.Layers".
  • Use new data in places of "Xtrain" and "Yrain" in the "trainNetwork" function.
Refer to the documentation link to know more about Neural Network layers in "trainNetwork" function.

类别

Help CenterFile Exchange 中查找有关 Custom Training Loops 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by