prune and then add to BayesNet
parent
26642f1ba0
commit
2644c4baa9
|
@ -58,11 +58,12 @@ HybridBayesNet HybridBayesNet::prune(size_t maxNrLeaves,
|
||||||
joint = joint * (*conditional);
|
joint = joint * (*conditional);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Prune the joint. NOTE: imperative and, again, possibly quite expensive.
|
||||||
|
joint.prune(maxNrLeaves);
|
||||||
|
|
||||||
// Create the result starting with the pruned joint.
|
// Create the result starting with the pruned joint.
|
||||||
HybridBayesNet result;
|
HybridBayesNet result;
|
||||||
result.emplace_shared<DiscreteConditional>(joint);
|
result.emplace_shared<DiscreteConditional>(joint);
|
||||||
// Prune the joint. NOTE: imperative and, again, possibly quite expensive.
|
|
||||||
result.back()->asDiscrete()->prune(maxNrLeaves);
|
|
||||||
|
|
||||||
// Get pruned discrete probabilities so
|
// Get pruned discrete probabilities so
|
||||||
// we can prune HybridGaussianConditionals.
|
// we can prune HybridGaussianConditionals.
|
||||||
|
|
Loading…
Reference in New Issue