Is there a command to measure the training time of a NARX network?

3 views (last 30 days)
Is there a command to measure the training time of a NARX network?
I would like to know if there is any command which I could make use of to measure the training time of NARX network. I am working towards stopping the neural network from training if it crosses a certain threshold time.
 

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Sep 2021
Edited: MathWorks Support Team on 30 Sep 2021
In order to monitor the training time or the epochs in the training of a NARX network, you can use the training record, which is the second argument returned by the train function. For example, if you have a NARX network in a variable "net", and network inputs and targets in variables "X", and "T" respectively, you can get the training record "tr" as follows:
>> [net,tr] = train(net,X,T);
The training record has various information about the training of the network which includes epochs in the training, and the training time. Please refer to the following link for more information on using the training record:
Also, if you need to specify maximum training time, or the number of epochs required for the training of your NARX network, "net", you can specify using the network training parameters. For example, you can access different training parameters for the network as follows:
>> net.trainParam
Further, to specify the maximum training time, or maximum epochs, you can set the "net.trainParam.time", or "net.trainParam.epochs" respectively.
Alternatively, you can measure the timing required for training by profiling the function using MATLAB Profiler, or by using the "tic" and "toc" stopwatch timer functions. Please refer to the following link for more information on profiling in MATLAB:

More Answers (0)

Community Treasure Hunt

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

Start Hunting!