Neural network code gives wrong output.!
1 回表示 (過去 30 日間)
古いコメントを表示
load('testfea.mat')
load('trainfea.mat')
T = [1 1 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 10 10 10 10 10 10 10 10 11 11 11 11 11 11 11 11 12 12 12 12 12 12 12 12 13 13 13 13 13 13 13 13 14 14 14 14 14 14 14 14 15 15 15 15 15 15 15 15 16 16 16 16 16 16 16 16];
P = trainfea';
net = newff(minmax(P),[6 1],{'tansig' 'purelin'});
Y = sim(net,P);
net.trainParam.epochs = 50;
net = train(net,P,T);
P = testfea';
Y = sim(net,P)
trainfea is 128x22 and testfea is 1x22 data, trainfea already contains testfea. But this code gives wrong index as output. Please correct my code for matching.!
0 件のコメント
採用された回答
Greg Heath
2017 年 3 月 13 日
1. What version of MATLAB do you have?
2. Why are you using the extremely obsolete function NEWFF?
3. Do you have the current functions
FITNET(regression/curvefitting)
and
PATTERNNET(classification/pattern-recognition)?
4. Why are you using non-default values of 6 and 50? Don't the defaults work?
5. There is no purpose of using Y = sim with a semicolon before training
6. What does " trainfea already contains testfea " mean??
7. You will probably have to design several nets in a loop to account for the random initial weights.
8. Search NEWSGROUP & ANSWERS using
greg newff
or
greg fitnet
for examples.
Hope this helps.
Thank you for formally accepting my answer
Greg
0 件のコメント
その他の回答 (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!