Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [recommenders-dev] recommenders-dev Digest, Vol 57, Issue 2

Hi Javier,
The p:int node is broken, it has an empty cpt. This causes the error you see. Check your code.

Regards, Michael

Am 06.10.2015 09:25 schrieb "Javier Martínez Torres" <javi.martineztorres@xxxxxxxxx>:
Michael, thank you for your prompt answer! The information managed is sensitive  but I faked the names of the nodes to show you the shape of the network. 
These are the nodes and LCPDs of the network:

Network size (num. of nodes):28
A cppe has the LCPD: 
[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]
A cgaac has the LCPD: 
[0.17, 0.83, 0.0, 1.0]
A cmcm has the LCPD: 
[0.38, 0.62, 0.36, 0.64, 0.31, 0.69, 0.28, 0.72, 0.36, 0.64, 0.28, 0.72, 0.28, 0.72, 0.0, 1.0]
NODE NAME:as:stg
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:loc
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:2
Childrens:
 p:afl
 p:acl
Num. Parents:0
Parents:
NODE NAME:as:net
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:sb
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:acc
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:1
Childrens:
 p:gacc
Num. Parents:0
Parents:
NODE NAME:as:cam
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:mic
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:1
Childrens:
 PERMISSION:RECORD_AUDIO
Num. Parents:0
Parents:
NODE NAME:as:btn
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:soc
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:dis
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:ainf
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:sysett
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:msgs
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:phca
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:dev
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:cal
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:sys
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:wall
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:ause
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:as:bat
Outcome count:2
Probs:[1.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:0
Parents:
NODE NAME:A:cppe
Outcome count:2
Probs:[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]
Num. Childrens:1
Childrens:
 p:int
Num. Parents:3
Parents:
 p:acl
 p:afl
 p:gacc
NODE NAME:p:int
Outcome count:2
Probs:[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
Num. Childrens:0
Childrens:
Num. Parents:3
Parents:
 A:cgaac
 A:cmcm
 A:cppe
NODE NAME:p:gacc
Outcome count:2
Probs:[0.11, 0.89, 0.0, 1.0]
Num. Childrens:3
Childrens:
 A:cppe
 A:cgaac
 A:cmcm
Num. Parents:1
Parents:
 as:acc
NODE NAME:p:afl
Outcome count:2
Probs:[0.06, 0.94, 0.0, 1.0]
Num. Childrens:2
Childrens:
 A:cppe
 A:cmcm
Num. Parents:1
Parents:
 as:loc
NODE NAME:p:acl
Outcome count:2
Probs:[0.06, 0.94, 0.0, 1.0]
Num. Childrens:1
Childrens:
 A:cppe
Num. Parents:1
Parents:
 as:loc
NODE NAME:A:cgaac
Outcome count:2
Probs:[0.17, 0.83, 0.0, 1.0]
Num. Childrens:1
Childrens:
 p:int
Num. Parents:1
Parents:
 p:gacc
NODE NAME:A:cmcm
Outcome count:2
Probs:[0.38, 0.62, 0.36, 0.64, 0.31, 0.69, 0.28, 0.72, 0.36, 0.64, 0.28, 0.72, 0.28, 0.72, 0.0, 1.0]
Num. Childrens:1
Childrens:
 p:int
Num. Parents:3
Parents:
 p:afl
 p:gacc
 p:rec
NODE NAME:p:rec
Outcome count:2
Probs:[0.03, 0.97, 0.0, 1.0]
Num. Childrens:1
Childrens:
 A:cmcm
Num. Parents:1
Parents:
 as:mic

On 5 October 2015 at 17:39, <recommenders-dev-request@xxxxxxxxxxx> wrote:
Send recommenders-dev mailing list submissions to
        recommenders-dev@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://dev.eclipse.org/mailman/listinfo/recommenders-dev
or, via email, send a message with subject or body 'help' to
        recommenders-dev-request@xxxxxxxxxxx

You can reach the person managing the list at
        recommenders-dev-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of recommenders-dev digest..."


Today's Topics:

   1. Weekly UI Freeze Digest for Recommenders
      (Eclipse Error Reports Bot)
   2. NumericalInstabilityException (Javier Mart?nez Torres)
   3. Re: NumericalInstabilityException (Michael Kutschke)


----------------------------------------------------------------------

Message: 1
Date: Mon, 5 Oct 2015 00:24:20 -0400 (EDT)
From: Eclipse Error Reports Bot <error-reports-bot@xxxxxxxxxxx>
To: recommenders-dev@xxxxxxxxxxx
Subject: [recommenders-dev] Weekly UI Freeze Digest for Recommenders
Message-ID:
        <1197795293.133.1444019060160.JavaMail.vsacct@recommenders>
Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/recommenders-dev/attachments/20151005/9238c92f/attachment.html>

------------------------------

Message: 2
Date: Mon, 5 Oct 2015 17:31:38 +0200
From: Javier Mart?nez Torres <javi.martineztorres@xxxxxxxxx>
To: recommenders-dev@xxxxxxxxxxx
Subject: [recommenders-dev] NumericalInstabilityException
Message-ID:
        <CACB-TG4sFJnOGK8XL_B7ACTRnaN50v0_r4DDrZ7w2inypoBUVw@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

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*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/recommenders-dev/attachments/20151005/bf2d9da7/attachment.html>

------------------------------

Message: 3
Date: Mon, 5 Oct 2015 17:39:38 +0200
From: Michael Kutschke <kutschke.michael@xxxxxxxxxxxxxx>
To: Recommenders developer discussions <recommenders-dev@xxxxxxxxxxx>
Subject: Re: [recommenders-dev] NumericalInstabilityException
Message-ID:
        <CACVbEoG=0P0sARo06ecxFXxitt8FiP895AMY-XPbN1rhsGvHaQ@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://dev.eclipse.org/mailman/private/recommenders-dev/attachments/20151005/77edec75/attachment.html>

------------------------------

_______________________________________________
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

End of recommenders-dev Digest, Vol 57, Issue 2
***********************************************



--
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