How to index when state is interval

The front end.
Post Reply
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

How to index when state is interval

Post by sponyo »

I found that when the state of a node is interval, this indexing method seems to be invalid, such as F=0 means that the first state. How to do it correctly?
Attachments
屏幕截图 2024-08-21 213459.png
屏幕截图 2024-08-21 213459.png (48.24 KiB) Viewed 2158 times
屏幕截图 2024-08-21 213439.png
屏幕截图 2024-08-21 213439.png (3.27 KiB) Viewed 2158 times
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

When the parent node is discrete and has intervals, the child equation node sees the value drawn uniformly from the interval selected by the posteriors of the parent (they are known when sampling is run, because discrete parent precedes the equation child in network's partial order).

In your example, you refer to parent F by equating it to zero. This will not work, even if the parent's interval incudes zero.

You have three options, see the attachment for a working example.

1. use intervals with identifiers in the discrete node. In such case, equating the parent with its outcome label will work as you'd expect. The child equation in the example is:

Code: Select all

A=If(X="S2",100,200)
The child node id is X, and it has a states defined with both intervals and identifiers. "S2" is the state id.

2. use the And function in the If function, and specify the interval boundaries

Code: Select all

B=If(And(X>=30,X<80),100,200)
The parent's state has the lower bound equal to 30 and the upper bound equal to 80. This will effectively return 100 if the parent is in the specified state, and 200 otherwise

3. when the intervals are used with identifiers, you can also use the Choose function:

Code: Select all

C=Choose(X,11,22,33)
The parent in the example has 3 states. Choose will automatically translate parent value into the integer state index, and will return 11, 22 or 33.
Attachments
how_to_reference_inteval.png
how_to_reference_inteval.png (18.19 KiB) Viewed 2152 times
how_to_reference_inteval.xdsl
(1.9 KiB) Downloaded 96 times
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

When I use the node ->ChangeType (DSL_CPT) method to convert a continuous node to a discrete node, is it converted to intervals by default? Is there a way to convert it to identifiers and intervals in SMILE?
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

The discrete node definition after the DSL_EQUATION to DSL_CPT change will have intervals if the original equation node had discretization intervals specified. Please note that the two discretization intervals will be set in the equation node if
a) equation node has no discretization intervals yet
and
b) discretization intervals are required to complete inference when sampling cannot be used and network needs to be discretized

Two discretization intervals per equation node is of course very raw approximation, and in practice you should always specify the discretization when you expect that your network will have evidence in nodes with parents (this is the condition which requires an automatic switch from sampling to discretization+discrete inference).
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

Thank you for your response! I understand, but I have another question. Is there a method in SMILE/GeNe to view the max cluster size when using the default inference algorithm clustering?
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

And may I ask if there are any methods to enable parallelism to improve the memory utilization of the computer? Currently, when setting node observation values and setting some nodes as targets, updating beliefs still fails, and the system shows that the model is too complex. However, I have observed that my memory is not fully utilized. Is there any way to solve the situation?
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

system shows that the model is too complex. However, I have observed that my memory is not fully utilized. Is there any way to solve the situation?
SMILE can determine if the model is too complex without actually trying to allocate the memory.

Regarding parallelism, SMILE does not support it yet. However, your application can use multiple threads with different network objects to perform simultaneous inference.
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

Okay, I understand. And is there a solution to this problem?
sponyo wrote: Fri Aug 23, 2024 6:57 pm Thank you for your response! I understand, but I have another question. Is there a method in SMILE/GeNe to view the max cluster size when using the default inference algorithm clustering?
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

We have a private, undocumented C++ only API which gets triangulation statistics, including cluster sizes. Send me a forum private message if you want to get info on how to use it.
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

I have sent a private message, please check it
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

Answered by PM earlier today.
sponyo
Posts: 7
Joined: Wed Jul 31, 2024 1:00 pm

Re: How to index when state is interval

Post by sponyo »

Hello! May I ask if there is a way to print a Junction tree?
shooltz[BayesFusion]
Site Admin
Posts: 1438
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to index when state is interval

Post by shooltz[BayesFusion] »

There's no such API in SMILE.
Post Reply