How to determine if the simulated result is matched?
古いコメントを表示
Here is my code:
inputData = rand(5, 56);
targetData = eye(56);
simInput = [a;b;c;d;e]; %%assume the value match 1 of the column in inputData
net = feedforwardnet(5);
net = train(net, inputData, targetData);
y1 = sim(net, simInput);
y2 = find(max(y1));
y2 should return a value that tell me which column it matched in inputData. However it only return 1 regardless the simInput. So am I using it right?
採用された回答
その他の回答 (1 件)
Walter Roberson
2015 年 9 月 6 日
You probably want
[maxy1, y2] = max(y1);
If y1 is a vector then max(y1) is going to be a scalar, and find() applied to a scalar is going to return [] if the scalar is 0 and is going to return 1 (the location of the non-zero element in the scalar) otherwise. find(max(y1)) does not mean to search y1 for its maximum and return the location in y2. Or maybe you just wanted to know what the maximum was; if so then just max() works.
2 件のコメント
Vishnu Rajen
2015 年 9 月 6 日
Walter Roberson
2015 年 9 月 6 日
My idea is that having only 1 sample per class is not adequate to train a neural network.
カテゴリ
ヘルプ センター および File Exchange で Downloads についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!