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 ...@@ -99,7 +99,7 @@ void NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::LabelsToMat(c
{ {
classLabel = kv.first; classLabel = kv.first;
kv.second = itLabel; kv.second = itLabel;
m_MatrixOfLabels.at<float>(0,itLabel) = classLabel; m_MatrixOfLabels.at<TOutputValue>(0,itLabel) = classLabel;
++itLabel; ++itLabel;
} }
...@@ -206,7 +206,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In ...@@ -206,7 +206,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
// MODE CLASSIFICATION : find the highest response // MODE CLASSIFICATION : find the highest response
float secondResponse = -1e10; float secondResponse = -1e10;
target[0] = m_MatrixOfLabels.at<float>(0); target[0] = m_MatrixOfLabels.at<TOutputValue>(0);
unsigned int nbClasses = m_MatrixOfLabels.size[1]; unsigned int nbClasses = m_MatrixOfLabels.size[1];
for (unsigned itLabel = 1; itLabel < nbClasses; ++itLabel) for (unsigned itLabel = 1; itLabel < nbClasses; ++itLabel)
...@@ -217,7 +217,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In ...@@ -217,7 +217,7 @@ NeuralNetworkMachineLearningModel<TInputValue, TOutputValue>::DoPredict(const In
secondResponse = maxResponse; secondResponse = maxResponse;
maxResponse = currentResponse; maxResponse = currentResponse;
target[0] = m_MatrixOfLabels.at<float>(itLabel); target[0] = m_MatrixOfLabels.at<TOutputValue>(itLabel);
} }
else 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