How to determine if the simulated result is matched?
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 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 commentaires
Vishnu Rajen
le 6 Sep 2015
Walter Roberson
le 6 Sep 2015
My idea is that having only 1 sample per class is not adequate to train a neural network.
Catégories
En savoir plus sur Deep Learning Toolbox dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!