- Create a function that checks the training loss. If the loss is below a specified threshold, the function returns true, signaling the training process to stop.
- Use the “trainingOptions” function to specify the training parameters, including the custom output function. Just pass this custom function handle to the "OutputFcn" name-value pair argument of “trainingOptions”.
Stopping LSTM NN Training on RMSE or Loss criteria
8 views (last 30 days)
Show older comments
Hello all,
Below the question in short, thereafter I will give more details about the particulair question.
Is there a possibility to stop the LSTM NN training when a certain performance criteria is met? See the attached picture with the training performance to get the idea why I'am looking for options.
E.g: at certain RMSE or loss.
If you have other idea's or options, please share them :)
More detail:
I am training a LSTM NN with 100 hidden neurons. My dataset contains 750 experiments with 25 features, each experiment represents one stroke of a machine forming metal. I'am studying one experiment at a time (batch size 63xx), this gives me most stable performance.
I used padding to get each experiment the same length. Learning rate is set fixed at 0.01.

0 Comments
Answers (1)
Jayanti
on 17 Dec 2024
Hi koen,
You can stop the training of an LSTM neural network in MATLAB by defining a custom stopping criteria.
Please refer to the following steps to implement custom stopping criteria
This function will be invoked at the start, during, and at the end of training. Training will stop when the “OutputFcn” returns “true”.
Please refer to the following documentation link for your reference:
Hope this is useful!
0 Comments
See Also
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!