Commit 75e0eeab authored by Maria Dimashova's avatar Maria Dimashova

fixed #2160

parent ed0a158c
...@@ -386,7 +386,8 @@ void EM::computeLogWeightDivDet() ...@@ -386,7 +386,8 @@ void EM::computeLogWeightDivDet()
for(int clusterIndex = 0; clusterIndex < nclusters; clusterIndex++) for(int clusterIndex = 0; clusterIndex < nclusters; clusterIndex++)
{ {
double logDetCov = 0.; double logDetCov = 0.;
for(int di = 0; di < covsEigenValues[clusterIndex].cols; di++) const int evalCount = covsEigenValues[clusterIndex].total();
for(int di = 0; di < evalCount; di++)
logDetCov += std::log(covsEigenValues[clusterIndex].at<double>(covMatType != EM::COV_MAT_SPHERICAL ? di : 0)); logDetCov += std::log(covsEigenValues[clusterIndex].at<double>(covMatType != EM::COV_MAT_SPHERICAL ? di : 0));
logWeightDivDet.at<double>(clusterIndex) = logWeights.at<double>(clusterIndex) - 0.5 * logDetCov; logWeightDivDet.at<double>(clusterIndex) = logWeights.at<double>(clusterIndex) - 0.5 * logDetCov;
......
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