Commit 411467ea authored by Maria Dimashova's avatar Maria Dimashova

fixed likelihood computing

parent 74325fe9
...@@ -530,7 +530,7 @@ void EM::computeProbabilities(const Mat& sample, int& label, Mat* probs, double* ...@@ -530,7 +530,7 @@ void EM::computeProbabilities(const Mat& sample, int& label, Mat* probs, double*
if(logLikelihood) if(logLikelihood)
{ {
double logWeightProbs = std::log(std::max(DBL_MIN, sum(*sampleProbs)[0])); double logWeightProbs = std::log(weights.dot(*sampleProbs));
*logLikelihood = logWeightProbs; *logLikelihood = logWeightProbs;
} }
} }
......
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