commit
648c68d130
|
@ -202,6 +202,11 @@ VectorValues HybridBayesTree::optimize(const DiscreteValues& assignment) const {
|
|||
|
||||
/* ************************************************************************* */
|
||||
void HybridBayesTree::prune(const size_t maxNrLeaves) {
|
||||
if (!this->roots_.at(0)->conditional()->asDiscrete()) {
|
||||
// Root of the BayesTree is not a discrete clique, so we do nothing.
|
||||
return;
|
||||
}
|
||||
|
||||
auto prunedDiscreteProbs =
|
||||
this->roots_.at(0)->conditional()->asDiscrete<TableDistribution>();
|
||||
|
||||
|
|
|
@ -99,7 +99,8 @@ AlgebraicDecisionTree<Key> HybridNonlinearFactor::errorTree(
|
|||
auto errorFunc =
|
||||
[continuousValues](const std::pair<sharedFactor, double>& f) {
|
||||
auto [factor, val] = f;
|
||||
return factor->error(continuousValues) + val;
|
||||
return factor ? factor->error(continuousValues) + val
|
||||
: std::numeric_limits<double>::infinity();
|
||||
};
|
||||
return {factors_, errorFunc};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue