problem with train function neural networks
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
I have a problem with train function
??? Error using ==> network.train
Targets are incorrectly sized for network.
Matrix must have 2 columns.
Error in ==> tfarst1 at 14
[net,tr]=train(net,min_max,f);
>> whos
Name Size Bytes Class
Fs 1x1 8 double array
d 22050x1 176400 double array
f 1x432 3456 double array
h 1x1 8 double array
h1 1x1 8 double array
m 432x12 41472 double array
min_max 432x2 6912 double array
net 1x1 85013 network object
s 55512x1 888192 double array (complex)
Grand total is 92380 elements using 1201469 bytes
I only have one output for each row how can I fix it?and this is my code
clear;clc
Fs=11025;
d=wavread('alhai.wav');
s=specgram(d,512,Fs,kaiser(500,5),400);
s=s(:);
m=melcepst(s,Fs);
min_max=minmax(m);
[h h1] = size(m);
f=ones(1,h);
net=newff(min_max,[5 1],{'tansig','purelin'},'trainlm');
net.trainParam.show=500;
net.trainParam.goal=1e-5;
net.trainParam.epochs=5000;
[net,tr]=train(net,min_max,f);
댓글 수: 0
답변 (1개)
Peter Manley-Cooke
2011년 3월 30일
I have forgotten most of the NN stuff and I no longer have a toobbox but, have you tried
[net,tr]=train(net,min_max,f'); ^ adding the ' symbol to transpose the column array to a row array so that it matches the rows of the data?
Also, in newff, I would expect the dimensions to match the data, say [2 1], or better [2 5 1], or is this done automatically? I can't find documentation for newff.
Sorry I'm not more current.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File 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!