How do Size input and Target correctly during training of Feed Forward Neural Network

4 次查看(过去 30 天)
I have a input data set consisting of 12 columns and 108 rows. The target data set consist of 1 column and 108 rows. While training my Neural Network the error message "Targets are incorrectly sized for network. Matrix must have 12 columns" is flagged. Please how do I solve this problem.
Note I am using R2008b version.
Here is my code
load RainData_Cal_Inputs.dat load RData_Cal_target yinputs= RainData_Cal_Inputs ytarget= RData_Cal_target;
[y11,PS] = mapminmax(yinputs)
[y22,PS] = mapminmax(ytarget);
y22=y22'
%Network traning and validation
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainParam.epochs = 200;
net = newff(y11,y22,12); net =init(net); net.trainParam.showCommandLine=true view(net) YY = sim(net,y11);
net = train(net,y11,y22)

采纳的回答

Greg Heath
Greg Heath 2014-6-1
Transpose your matrices so that
[ I N ] = size(input) %[ 12 108 ]
[ O N ] = size(target) %[ 1 108 ]
Then search
greg newff
Hope this helps.
Thank you for formally accepting my answer
Greg

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by