Skip to main content

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

Hi Javier,
how does your network look like? Is it deep or broad?
Check that you properly initialised all nodes, one possible reason is that one of the CPTs is not initialised.
The error happens when during the computation, one of the CPTs becomes all zeroes. This can happen with very big networks, but should generally not for a 28 node network.

Regards, Michael

Am 05.10.2015 17:31 schrieb "Javier Martínez Torres" <javi.martineztorres@xxxxxxxxx>:
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


_______________________________________________
recommenders-dev mailing list
recommenders-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/recommenders-dev

Back to the top