remove timers
parent
62d020a531
commit
df0c5d7ca0
|
|
@ -129,7 +129,6 @@ std::function<double(const Assignment<Key> &, double)> prunerFunc(
|
||||||
DecisionTreeFactor HybridBayesNet::pruneDiscreteConditionals(
|
DecisionTreeFactor HybridBayesNet::pruneDiscreteConditionals(
|
||||||
size_t maxNrLeaves) {
|
size_t maxNrLeaves) {
|
||||||
// Get the joint distribution of only the discrete keys
|
// Get the joint distribution of only the discrete keys
|
||||||
gttic_(HybridBayesNet_PruneDiscreteConditionals);
|
|
||||||
// The joint discrete probability.
|
// The joint discrete probability.
|
||||||
DiscreteConditional discreteProbs;
|
DiscreteConditional discreteProbs;
|
||||||
|
|
||||||
|
|
@ -147,12 +146,11 @@ DecisionTreeFactor HybridBayesNet::pruneDiscreteConditionals(
|
||||||
discrete_factor_idxs.push_back(i);
|
discrete_factor_idxs.push_back(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const DecisionTreeFactor prunedDiscreteProbs =
|
const DecisionTreeFactor prunedDiscreteProbs =
|
||||||
discreteProbs.prune(maxNrLeaves);
|
discreteProbs.prune(maxNrLeaves);
|
||||||
gttoc_(HybridBayesNet_PruneDiscreteConditionals);
|
|
||||||
|
|
||||||
// Eliminate joint probability back into conditionals
|
// Eliminate joint probability back into conditionals
|
||||||
gttic_(HybridBayesNet_UpdateDiscreteConditionals);
|
|
||||||
DiscreteFactorGraph dfg{prunedDiscreteProbs};
|
DiscreteFactorGraph dfg{prunedDiscreteProbs};
|
||||||
DiscreteBayesNet::shared_ptr dbn = dfg.eliminateSequential(discrete_frontals);
|
DiscreteBayesNet::shared_ptr dbn = dfg.eliminateSequential(discrete_frontals);
|
||||||
|
|
||||||
|
|
@ -161,7 +159,6 @@ DecisionTreeFactor HybridBayesNet::pruneDiscreteConditionals(
|
||||||
size_t idx = discrete_factor_idxs.at(i);
|
size_t idx = discrete_factor_idxs.at(i);
|
||||||
this->at(idx) = std::make_shared<HybridConditional>(dbn->at(i));
|
this->at(idx) = std::make_shared<HybridConditional>(dbn->at(i));
|
||||||
}
|
}
|
||||||
gttoc_(HybridBayesNet_UpdateDiscreteConditionals);
|
|
||||||
|
|
||||||
return prunedDiscreteProbs;
|
return prunedDiscreteProbs;
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +177,6 @@ HybridBayesNet HybridBayesNet::prune(size_t maxNrLeaves) {
|
||||||
|
|
||||||
HybridBayesNet prunedBayesNetFragment;
|
HybridBayesNet prunedBayesNetFragment;
|
||||||
|
|
||||||
gttic_(HybridBayesNet_PruneMixtures);
|
|
||||||
// Go through all the conditionals in the
|
// Go through all the conditionals in the
|
||||||
// Bayes Net and prune them as per prunedDiscreteProbs.
|
// Bayes Net and prune them as per prunedDiscreteProbs.
|
||||||
for (auto &&conditional : *this) {
|
for (auto &&conditional : *this) {
|
||||||
|
|
@ -197,7 +193,6 @@ HybridBayesNet HybridBayesNet::prune(size_t maxNrLeaves) {
|
||||||
prunedBayesNetFragment.push_back(conditional);
|
prunedBayesNetFragment.push_back(conditional);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gttoc_(HybridBayesNet_PruneMixtures);
|
|
||||||
|
|
||||||
return prunedBayesNetFragment;
|
return prunedBayesNetFragment;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ static GaussianFactorGraphTree addGaussian(
|
||||||
// TODO(dellaert): it's probably more efficient to first collect the discrete
|
// TODO(dellaert): it's probably more efficient to first collect the discrete
|
||||||
// keys, and then loop over all assignments to populate a vector.
|
// keys, and then loop over all assignments to populate a vector.
|
||||||
GaussianFactorGraphTree HybridGaussianFactorGraph::assembleGraphTree() const {
|
GaussianFactorGraphTree HybridGaussianFactorGraph::assembleGraphTree() const {
|
||||||
gttic_(assembleGraphTree);
|
|
||||||
|
|
||||||
GaussianFactorGraphTree result;
|
GaussianFactorGraphTree result;
|
||||||
|
|
||||||
|
|
@ -129,8 +128,6 @@ GaussianFactorGraphTree HybridGaussianFactorGraph::assembleGraphTree() const {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gttoc_(assembleGraphTree);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue