How do Size input and Target correctly during training of Feed Forward Neural Network
3 views (last 30 days)
Show older comments
udoInyang inyang
on 1 Jun 2014
Commented: udoInyang inyang
on 1 Jun 2014
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)
0 Comments
Accepted Answer
Greg Heath
on 1 Jun 2014
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
More Answers (0)
See Also
Categories
Find more on Sequence and Numeric Feature Data Workflows in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!