how to check RMSE of trained neural network?

조회 수: 6 (최근 30일)
Saba Yousaf
Saba Yousaf 2018년 8월 16일
답변: Purvaja 2025년 2월 20일
i want to check the error performance like errors like RMSE, mean Absolute Error, Mean Absolute percentage error of trained neural network?

답변 (1개)

Purvaja
Purvaja 2025년 2월 20일
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”:
  • First create an object:
metric = rmseMetric(NormalizationFactor="batch-size")
  • Specify RMSE metric in training options:
options = trainingOptions("adam", ...
MaxEpochs=5, ...
Metrics=metric, ...
ValidationData={XTest,anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
Verbose=true);
2. For MAE use “mae”:
  • in “trainnet()” function set the loss function by specifying “mae:
options = trainingOptions("adam", ...
MaxEpochs=10, ...
Metrics="mae", ... % Specify MAE as the metric
ValidationData={XTest, anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
Verbose=true);
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", ...
MaxEpochs=10, ...
Metrics=metric, ...
ValidationData={XTest,anglesTest}, ...
ValidationFrequency=50, ...
Plots="training-progress", ...
Verbose=true);
You can also go through following documentation link to know more about above function:
  1. RMSE: https://www.mathworks.com/help/deeplearning/ref/deep.metric.rmsemetric.html
  2. MAE: https://www.mathworks.com/help/deeplearning/ref/mae.html
  3. 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!

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by