필터 지우기
필터 지우기

Regression neural network, manual computation

조회 수: 11 (최근 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 CenterFile Exchange에서 Predictive Maintenance Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by