Different matrix dimention of input and target in neural networks?

Why couldn't I get the network to work with a 1x250 input and a 2x250 target? When the input and target are both a 2x250 matrix the program worked just fine. My inputs and targets are taken from excel. I didn't know how to fix this problem.
This is the code: Ptr=xlsread('liaa(10s).xlsx','sheet1','I3:I252');
T=xlsread('liaa(10s).xlsx','sheet1','G3:H252');
net=newff(Ptr,T,4,{'logsig','purelin'},'trainlm','learngdm');
net.trainParam.lr=0.5; net.trainParam.epochs=25; net.trainParam.goal=1e-10;
[net,tr]=train(net,Ptr,T);
and the error said: ??? Error using ==> network.train at 146 Targets are incorrectly sized for network. Matrix must have 1 columns.
Error in ==> training_lia at 11 [net,tr]=train(net,Ptr,T);

1 件のコメント

Geoff Hayes
Geoff Hayes 2014 年 10 月 6 日
Amalia - if you are observing an error, then please include the error message and any text that is relevant. Including a portion of your code that, when executed, generates the error would be helpful too.

サインインしてコメントする。

 採用された回答

Greg Heath
Greg Heath 2014 年 10 月 7 日

1 投票

You may have to transpose your data
Check dimensions
[ I N ] = size(input) % [ 1 250]
[ O N ] = size(target)% [ 2 250 ]
P.S. To simplify your code, use default parameters whenever possible. See the examples in
help newff
doc newff
Hope this helps.
Thank you for formally accepting my answer
Greg

1 件のコメント

Amalia
Amalia 2014 年 10 月 8 日
THIS HELPS! thank you very much :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDeep Learning Toolbox についてさらに検索

質問済み:

2014 年 10 月 6 日

コメント済み:

2014 年 10 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by