Go to the documentation of this file.
32 template class BayesTreeCliqueBase<HybridBayesTreeClique,
33 HybridGaussianFactorGraph>;
34 template class BayesTree<HybridBayesTreeClique>;
51 if (root_conditional->isDiscrete()) {
52 dbn.
push_back(root_conditional->asDiscrete());
55 throw std::runtime_error(
56 "HybridBayesTree root is not discrete-only. Please check elimination "
57 "ordering or use continuous factor graph.");
89 : assignment_(assignment),
90 parentClique_(parentClique),
91 gaussianbayesTree_(gbt),
111 if (hybrid_conditional->isHybrid()) {
112 conditional = (*hybrid_conditional->asMixture())(
parentData.assignment_);
113 }
else if (hybrid_conditional->isContinuous()) {
114 conditional = hybrid_conditional->asGaussian();
117 conditional = std::make_shared<GaussianConditional>();
123 clique = std::make_shared<GaussianBayesTree::Node>(conditional);
125 parentData.gaussianbayesTree_->addClique(clique,
146 treeTraversal::no_op visitorPost;
165 if (gbt.
size() == 0) {
176 auto discreteProbs = this->
roots_.at(0)->conditional()->asDiscrete();
179 discreteProbs->
root_ = prunedDiscreteProbs.
root_;
182 struct HybridPrunerData {
187 : prunedDiscreteProbs(prunedDiscreteProbs) {}
197 static HybridPrunerData AssignmentPreOrderVisitor(
204 if (conditional->isHybrid()) {
205 auto gaussianMixture = conditional->asMixture();
207 gaussianMixture->prune(
parentData.prunedDiscreteProbs);
213 HybridPrunerData rootData(prunedDiscreteProbs, 0);
215 treeTraversal::no_op visitorPost;
219 *
this, rootData, HybridPrunerData::AssignmentPreOrderVisitor,
std::shared_ptr< This > shared_ptr
shared_ptr to this class
HybridAssignmentData(const DiscreteValues &assignment, const GaussianBayesTree::sharedNode &parentClique, GaussianBayesTree *gbt, bool valid=true)
Construct a new Hybrid Assignment Data object.
DecisionTreeFactor prune(size_t maxNrAssignments) const
Prune the decision tree of discrete variables.
A Bayes net of Gaussian Conditionals indexed by discrete keys.
const DiscreteValues assignment_
static HybridAssignmentData AssignmentPreOrderVisitor(const HybridBayesTree::sharedNode &node, HybridAssignmentData &parentData)
A function used during tree traversal that operates on each node before visiting the node's children.
NodePtr root_
A DecisionTree just contains the root. TODO(dellaert): make protected.
const sharedClique & clique(Key j) const
HybridValues optimize() const
Optimize the hybrid Bayes tree by computing the MPE for the current set of discrete variables and usi...
Hybrid Bayes Tree, the result of eliminating a HybridJunctionTree.
VectorValues optimize() const
GaussianBayesTree * gaussianbayesTree_
GaussianBayesTree choose(const DiscreteValues &assignment) const
Get the Gaussian Bayes Tree which corresponds to a specific discrete value assignment.
void DepthFirstForestParallel(FOREST &forest, DATA &rootData, VISITOR_PRE &visitorPre, VISITOR_POST &visitorPost, int problemSizeThreshold=10)
IsDerived< DERIVEDFACTOR > push_back(std::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
Helper class for Depth First Forest traversal on the HybridBayesTree.
sharedClique sharedNode
Synonym for sharedClique (TODO: remove)
void prune(const size_t maxNumberLeaves)
Prune the underlying Bayes tree.
bool equals(const This &other, double tol=1e-9) const
Base class for cliques of a BayesTree.
DiscreteValues optimize(OptionalOrderingType orderingType={}) const
Find the maximum probable explanation (MPE) by doing max-product.
Bayes Tree is a tree of cliques of a Bayes Chain.
GaussianBayesTree::sharedNode parentClique_
bool equals(const This &other, double tol=1e-9) const
gtsam
Author(s):
autogenerated on Tue Jun 25 2024 03:01:00