You can calculate Root Mean Squared Error (RMSE), Mean Absolute Error (MAE), Mean Absolute Percentage Error (MAPE) using following functions available in MATLAB.
1. For calculating RMSE you use “rmseMetric”:
metric = rmseMetric(NormalizationFactor="batch-size")
- Specify RMSE metric in training options:
options = trainingOptions("adam", ...
ValidationData={XTest,anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
2. For MAE use “mae”:
- in “trainnet()” function set the loss function by specifying “mae”:
options = trainingOptions("adam", ...
ValidationData={XTest, anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
3. For MAPE use “mapeMetric”:
- Similar to RMSE first create an object:
metric = mapeMetric(NormalizationFactor="batch-size")
- Specify the MAPE metric in the training options.
options = trainingOptions("adam", ...
ValidationData={XTest,anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
You can also go through following documentation link to know more about above function:
- RMSE: https://www.mathworks.com/help/deeplearning/ref/deep.metric.rmsemetric.html
- MAE: https://www.mathworks.com/help/deeplearning/ref/mae.html
- MAPE: https://www.mathworks.com/help/deeplearning/ref/deep.metric.mapemetric.html
You can also try this command in your MATLAB command window for specific release documentation respectively:
web(fullfile(docroot,'deeplearning/ref/deep.metric.rmsemetric.html'))
web(fullfile(docroot,'deeplearning/ref/mae.html'))
web(fullfile(docroot,'deeplearning/ref/deep.metric.mapemetric.html'))
Hope this helps you!