How to determine if the simulated result is matched?
Ältere Kommentare anzeigen
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?
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 6 Sep. 2015
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 Kommentare
Vishnu Rajen
am 6 Sep. 2015
Walter Roberson
am 6 Sep. 2015
My idea is that having only 1 sample per class is not adequate to train a neural network.
Kategorien
Mehr zu Downloads finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!