heuristic to improve results with fove
This commit is contained in:
parent
2b7da4bc23
commit
09697b8461
@ -84,7 +84,7 @@ SumOutOperator::getLogCost (void)
|
|||||||
++ pfIter;
|
++ pfIter;
|
||||||
}
|
}
|
||||||
if (nrProdFactors == 1) {
|
if (nrProdFactors == 1) {
|
||||||
return 1.0; // best possible case
|
return std::log (1.0); // best possible case
|
||||||
}
|
}
|
||||||
double cost = 1.0;
|
double cost = 1.0;
|
||||||
for (unsigned i = 0; i < groupSet.size(); i++) {
|
for (unsigned i = 0; i < groupSet.size(); i++) {
|
||||||
@ -252,6 +252,9 @@ CountingOperator::getLogCost (void)
|
|||||||
for (unsigned i = 0; i < counts.size(); i++) {
|
for (unsigned i = 0; i < counts.size(); i++) {
|
||||||
cost += size * HistogramSet::nrHistograms (counts[i], range);
|
cost += size * HistogramSet::nrHistograms (counts[i], range);
|
||||||
}
|
}
|
||||||
|
if ((*pfIter_)->nrArguments() == 1) {
|
||||||
|
cost *= 3; // avoid counting conversion in the beginning
|
||||||
|
}
|
||||||
return std::log (cost);
|
return std::log (cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user