필터 지우기
필터 지우기

Neural networks toolbox, error weights, get an error

조회 수: 2 (최근 30일)
Leonid
Leonid 2011년 6월 29일
댓글: PALASH MONDAL 2018년 3월 9일
Hello!
I'm trying to run the following script
x=eye(12);
t = [0 1 1 0 1 0 0 0 1 1 0 1];
ew = (t==0)*0.5 + (t==1);
net = feedforwardnet(10);
net = configure(net,x,t);
net = train(net,x,t,[],[],ew);
And i got an error message ??? Error using ==> trainlm at 109 Inputs and input states have different numbers of samples.
Error in ==> network.train at 107 [net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
Error in ==> Untitled at 7 net = train(net,x,t,[],[],ew);
Without the ew parameter it works pretty good:
net = train(net,x,t);
The question is, how can I properly set error weights for targets? I use MATLAB 2010b.
Thank you in advance, Leonid
  댓글 수: 1
PALASH MONDAL
PALASH MONDAL 2018년 3월 9일
My dear as your mention code above is now perfectly running on Matlab 2017a without any modification. There is no error as you mention as line wise.

댓글을 달려면 로그인하십시오.

답변 (2개)

Francois
Francois 2011년 7월 14일
Contacted Mathworks,
this is the right code
[net,tr] = train(net,x,t,{},{},EW);
I used it, and it works great!
  댓글 수: 2
Nuno
Nuno 2011년 7월 14일
Yes, this is right code... Don't understand error...
Leonid
Leonid 2011년 7월 15일
Thank you!

댓글을 달려면 로그인하십시오.


Francois
Francois 2011년 7월 7일
I have the same problem,
[net,tr] = train(net,x,t,[],[],EW);
??? Error using ==> trainlm at 109
Inputs and input states have different numbers of samples.
Error in ==> network.train at 107
[net,tr] = feval(net.trainFcn,net,X,T,Xi,Ai,EW,net.trainParam);
the problem is not with EW but with Xi and Ai, and this is not easy to write. If someone has done it before an example would be appreciated!
  댓글 수: 1
Friedrich
Friedrich 2011년 7월 15일
looks like an empty cell {} is needed instead of an emtpy array [],

댓글을 달려면 로그인하십시오.

카테고리

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