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

7 views (last 30 days)
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

Answers (1)

Milan Bansal
Milan Bansal on 15 Sep 2023
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.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!