RBF network occurs an error when predicting data

10 次查看(过去 30 天)
When I tried to use the RBF network model to predict a very simple function, the input X can't exceed the training range or the output Y will become a constant. It means that the RBF network can't used to predict new datas, which is not correct.
My MATLAB is 2020b and academic licence.
AryX = 0:1000;
AryY = sin(AryX/100);
% train
MainNet = newrbe(AryX(1:500),AryY(1:500));
% predict
AryPred = MainNet(AryX);%sim(MainNet,AryX);
% calculate error
AryErr = AryPred - AryY;
% drawing
plot(AryX,AryY,'r-');
hold on
plot(AryX,AryPred,'b--');
hold off

回答(1 个)

Rijuta
Rijuta 2023-2-23
Hi,
I understand that you are training an RBF network using only the first 500 samples of the sine function, and then testing the network on the entire range of 0 to 1000. Due to this, the network performs poorly for inputs that are outside the training range giving a constant output.
It is advised to split your sample, increase the size of your training set, and use only the remaining samples for testing. For example, the first 800 samples can be used to train the network and then testing can be done on the remaining 200. Alternatively, you can also train the RBF network using a larger range of inputs, and then use it to predict the sine function values for the range of 0 to 1000.

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

标签

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by