Commit 853974ed authored by Cédric Traizet's avatar Cédric Traizet
Browse files

BUG: use template output type when fetching label values in NeuralNetworkMachineLearningModel

parent a1fbb467
Pipeline #7443 failed with stages
in 73 minutes and 36 seconds
......@@ -99,7 +99,7 @@ void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::LabelsToMat(c
{
classLabel = kv.first;
kv.second = itLabel;
m_MatrixOfLabels.at<float>(0,itLabel) = classLabel;
m_MatrixOfLabels.at<TOutputValue>(0,itLabel) = classLabel;
++itLabel;
}
......@@ -206,7 +206,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
// MODE CLASSIFICATION : find the highest response
float secondResponse = -1e10;
target[0] = m_MatrixOfLabels.at<float>(0);
target[0] = m_MatrixOfLabels.at<TOutputValue>(0);
unsigned int nbClasses = m_MatrixOfLabels.size[1];
for (unsigned itLabel = 1; itLabel < nbClasses; ++itLabel)
......@@ -217,7 +217,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
secondResponse = maxResponse;
maxResponse = currentResponse;
target[0] = m_MatrixOfLabels.at<float>(itLabel);
target[0] = m_MatrixOfLabels.at<TOutputValue>(itLabel);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment