Add discrete contribution to logProbability

release/4.3a0
Frank Dellaert 2023-01-13 08:24:31 -08:00
parent 03ad393e12
commit 906330f0e4
1 changed files with 5 additions and 3 deletions

View File

@ -311,9 +311,11 @@ AlgebraicDecisionTree<Key> HybridBayesNet::logProbability(
return leaf_value + logProbability; return leaf_value + logProbability;
}); });
} else if (auto dc = conditional->asDiscrete()) { } else if (auto dc = conditional->asDiscrete()) {
// TODO(dellaert): if discrete, we need to add logProbability in the right // If discrete, add the discrete logProbability in the right branch
// branch? result = result.apply(
continue; [dc](const Assignment<Key> &assignment, double leaf_value) {
return leaf_value + dc->logProbability(DiscreteValues(assignment));
});
} }
} }