SMILE error -51 in AddArc/Arc rejected by child node

The engine.
Post Reply
ystf
Posts: 7
Joined: Wed Jul 02, 2008 12:40 pm

SMILE error -51 in AddArc/Arc rejected by child node

Post by ystf »

I get this error:

smile.SMILEException: SMILE error -51 in function AddArc. Logged information: Arc rejected by child node

at smile.Network.addArc(Native Method)

and additionally:

smile.SMILEException: bad allocation
at smile.Network.addArc(Native Method)

What do I have to take care of? Is it because I have a cycle in my network, and if so how can I check where the cycle is formed? or what else? what is error -51?

Thanks.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by shooltz[BayesFusion] »

-51 translates to DSL_WRONG_NODE_TYPE. This is usually reported when you're trying to add an unsupported combination of parent/child types, like arc from utility to decision node.

However, the 'bad allocation' suggests that you have large CPT in child, and the memory is exhausted when you're adding another incoming arc. Note that each new arc at least doubles the memory required for the CPT (and previous table is stored in memory until new one is completely intialized, so it's like 3x increase in used memory).
ystf
Posts: 7
Joined: Wed Jul 02, 2008 12:40 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by ystf »

Is there a max number of parents that can be added to a node, so that I can check when this number is reached and no longer add arcs?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by shooltz[BayesFusion] »

ystf wrote:Is there a max number of parents that can be added to a node, so that I can check when this number is reached and no longer add arcs?
There's no hardcoded limit on the parent count. Note that the enlargement of child CPT depends on the number of parent's states, so new single parent with 4 states has the same effect as two new parents, each with 2 states.

To estimate the size of the CPT of given node, multiply all the parent state counts and state count of this node. This gives you the number of CPT entires, each of which is 8-byte double precision FP number.
ystf
Posts: 7
Joined: Wed Jul 02, 2008 12:40 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by ystf »

So if I got it right, the formula should look like this:

Size = 8 byte * number of parent states * number of states of this node,

and this Size should always be lower than what number? I am trying to settle a MAX number until I can still add arcs.

Thanks a lot again.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by shooltz[BayesFusion] »

ystf wrote:Size = 8 byte * number of parent states * number of states of this node
I'd replace 'number of parent states' with 'numstatp_1 * numstatp_2 * ... * numstatp_n', wheren numstatp_i is the number of states of ith parent of this node.

Such formula gives you the size of CPT of single node. It doesn't answer the question how many arcs you can still add. Note that amount of available memory in any multitasking OS changes dynamically (as other applications and system processes allocate/deallocate). Generally, it's not possible to predict if adding new arc will succeed.

Also note that even when arc is added, the inference (UpdateBeliefs call) may fail due to lack of memory. The algorithms used for inference create their own, temporary data structures which can exhaust the available RAM easily if network is very complex.
ystf
Posts: 7
Joined: Wed Jul 02, 2008 12:40 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by ystf »

So there is no actual solution to this problem - how many arcs can I add, but just a matter of catching that exception and moving forward ?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by shooltz[BayesFusion] »

ystf wrote:So there is no actual solution to this problem - how many arcs can I add, but just a matter of catching that exception and moving forward ?
Depends on the meaning of 'moving forward'. If new arc causes some CPT to grow and exhaust the memory, your network already may be too complex to infer.

What are you trying to do, anyway - are you adding the arcs at random?
ystf
Posts: 7
Joined: Wed Jul 02, 2008 12:40 pm

Re: SMILE error -51 in AddArc/Arc rejected by child node

Post by ystf »

Well, I am trying to build a BN over the structure of a desktop, and nodes would be relations between files - just imagine having a node for each 2 files, this would already mean n^2 nodes just from building the nodes. And then come the inferred relations which can be several to a node and so on... so a lot of nodes...
Post Reply