Regression neural network, manual computation

2 ビュー (過去 30 日間)
robinson medina
robinson medina 2022 年 4 月 8 日
コメント済み: robinson medina 2023 年 10 月 16 日
Hi all
I basically want to manually compute the response of a regression-based neural network.
To do so, I am using the command fitrnet, which generates a RegressionNeuralNetwork class. If I use the build in commands from maltab (i.e., predict) to calculate the response of the neural network, the response is very accurate.
Now, I want to manually calculate such a result (something like output = f(input*gain + offset)). I know that there is a normalization step automatically applied in matlab to the inputs, which uses the command mapminmax. However, I cannot find anywhere in the neural network class where the normalization limits are (i.e., the result of mapminmax). Can anyone help me with that?
This is the basic command I amusing:
regressionNeuralNetwork = fitrnet(...
trainingPredictors, ...
trainingResponse, ...
'LayerSizes', 1, ...
'Activations', 'relu', ...
'Lambda', 0, ...
'IterationLimit', 5000, ...
'Standardize', true, 'verbose', 1);
I guess that the predictors and the response are irrelevant for the question.
Thanks in advance!

採用された回答

Sai Pavan
Sai Pavan 2023 年 10 月 13 日
Hi Robinson,
I understand that you are trying to access the normalization limits that are automatically generated while using the “fitrnetfunction so that you can manually get the response of the trained network on normalized test data inputs.
The normalization limits used by “mapminmax” are not directly accessible from the “RegressionNeuralNetwork” object created by the “fitrnet” function. However, you can manually calculate the normalization limits based on the input data following the below steps.
  • Before training the RegressionNeuralNetwork object, you can use the mapminmax function to normalize the input data. This function returns the normalization limits used for each input dimension.
[normalizedData, normalizationSettings] = mapminmax(trainingPredictors);
  • You can access the normalization limits for each input dimension using the normalizationSettings structure.
minLimits = normalizationSettings.xmin;
maxLimits = normalizationSettings.xmax;
  • If you want to normalize new, unseen data, you should use the same normalization limits obtained using “mapminmax, that are specific to the training data, to ensure consistency.
Please refer to the workflow mentioned in the below documentation to learn how to apply normalization manually on the test inputs using the “mapminmax” function:
Hope it helps.
Regards,
Sai Pavan

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePredictive Maintenance Toolbox についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by