Clear Filters
Clear Filters

How to return a final training loss value?

11 views (last 30 days)
Sho Wright
Sho Wright on 6 Apr 2021
Answered: Lokesh on 13 Oct 2023
I want to evaluate the results of my network at various settings (changing batch size, maximum epochs, dropout layer rates,etc).
I've set my 'verbose' to true to extract data as to obtain mini-batch and validation RMSE/loss data per epoch, and I want to compare my final validation loss against my final training loss, as from what I know these can be compared to see if your network has resulted in underfitting, overfitting or optimally.
I have used 'info' to return my final results but the training loss is stated as a single column
Is there any way to get a final training loss, the same way I have a final validation loss and RMSE?
Thank you

Answers (1)

Lokesh on 13 Oct 2023
Hi Wright,
I understand that you want to obtain the value of the final training loss. However, ‘info.TrainingLoss’ consists of a column of values rather than a single value.
The ‘info.TrainingLoss’ variable contains a column of values, where each element corresponds to the loss for a particular iteration. For example, ‘info.TrainingLoss(1)’ corresponds to the training loss for the first iteration, ‘info.TrainingLoss(2)’ corresponds to the training loss for the second iteration, and so on. By accessing ‘info.TrainingLoss(end)’, you can retrieve the value of the final training loss.
I hope you find this helpful.
Best Regards,


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!