small improvements
parent
ac52be9cf0
commit
b79c69b408
|
@ -234,13 +234,13 @@ continuousElimination(const HybridGaussianFactorGraph &factors,
|
||||||
* and then exponentiate to create a DecisionTreeFactor (not normalized yet!).
|
* and then exponentiate to create a DecisionTreeFactor (not normalized yet!).
|
||||||
*
|
*
|
||||||
* @param errors DecisionTree of (unnormalized) errors.
|
* @param errors DecisionTree of (unnormalized) errors.
|
||||||
* @return AlgebraicDecisionTree<Key>
|
* @return DecisionTreeFactor::shared_ptr
|
||||||
*/
|
*/
|
||||||
static DecisionTreeFactor::shared_ptr DiscreteFactorFromErrors(
|
static DecisionTreeFactor::shared_ptr DiscreteFactorFromErrors(
|
||||||
const DiscreteKeys &discreteKeys,
|
const DiscreteKeys &discreteKeys,
|
||||||
const AlgebraicDecisionTree<Key> &errors) {
|
const AlgebraicDecisionTree<Key> &errors) {
|
||||||
double min_log = errors.min();
|
double min_log = errors.min();
|
||||||
AlgebraicDecisionTree<Key> potentials = DecisionTree<Key, double>(
|
AlgebraicDecisionTree<Key> potentials(
|
||||||
errors, [&min_log](const double x) { return exp(-(x - min_log)); });
|
errors, [&min_log](const double x) { return exp(-(x - min_log)); });
|
||||||
return std::make_shared<DecisionTreeFactor>(discreteKeys, potentials);
|
return std::make_shared<DecisionTreeFactor>(discreteKeys, potentials);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue