Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can pass a result mat to ann->predict(), which will hold the logit values from the last layer:

Mat result;
float predicted = ann->predict(query, result);
cerr << predicted << " " << result << endl;

you can pass a result mat to ann->predict(), which will hold the logit values from the last layer:

Mat result;
float predicted = ann->predict(query, result);
cerr << predicted << " " << result << endl;

for N classes (output neurons), you will receive an [Nx1] float mat, the prediction value is derived from that internally by calling minMaxLoc().