Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[recommenders-dev] NumericalInstabilityException

Dear all,

I am having problems with the method "inferer.getBeliefs". The call raise a NumericalInstabilityException. The trace is shown below:

Exception in thread "main" org.eclipse.recommenders.jayes.util.NumericalInstabilityException: Numerical instability detected for evidence: {} and node : 20, consider using logarithmic scale computation (configurable in FactorFactory)
at org.eclipse.recommenders.jayes.inference.junctionTree.JunctionTreeAlgorithm.validateBelief(JunctionTreeAlgorithm.java:99)
at org.eclipse.recommenders.jayes.inference.junctionTree.JunctionTreeAlgorithm.getBeliefs(JunctionTreeAlgorithm.java:80)
at DynamicRiskBayesianNetwork.main(DynamicRiskBayesianNetwork.java:288)
Caused by: java.lang.IllegalArgumentException: Cannot normalize a zero-Vector!
at org.eclipse.recommenders.jayes.util.MathUtils.normalize(MathUtils.java:44)
at org.eclipse.recommenders.jayes.inference.junctionTree.JunctionTreeAlgorithm.validateBelief(JunctionTreeAlgorithm.java:97)
... 2 more

The factory uses logarithmic scale:
                JunctionTreeAlgorithm inferer = new JunctionTreeAlgorithm();
inferer.getFactory().setUseLogScale(true);
inferer.getFactory().setFloatingPointType(float.class);
JunctionTreeBuilder builder = JunctionTreeBuilder.forHeuristic(new MinFillIn());
inferer.setJunctionTreeBuilder(builder);
inferer.setNetwork(net);

The network size (num. of nodes) is 28. The largest LCPD is like this: [0.44, 0.56, 0.37, 0.63, 0.4, 0.6, 0.33, 0.67, 0.37, 0.63, 0.33, 0.67, 0.33, 0.67, 0.0, 1.0]

What could I try to solve the problem?

Thanks in advance,

--
Javier Martínez Torres


Back to the top