Questions about defining a custom node and rules example. #339
Replies: 1 comment 2 replies
-
Hi, In general, necessary rules depend on both the algorithm used to infer and the model in which the node is used. When all variables attached to a node have been updated except one, RxInfer will always try to update the last one by calling a rule of this node. Note that feeding a data variable with a new value is an update. This implies that after feeding each data variable a new value, messages will fly through the graph, updating once each variable. This way, you can infer a posterior with the belief propagation algorithm, which computes Baye's posterior. To determine the required rules, I advise you to draw the graphical representation of your model like in the Getting started documentation page. If you want to run the belief propagation algorithm, you must write a rule for any message that flows out of a node to reach an hidden variable. I wrote an abstract example below and hope that it will help. Data variables are noted model graph For instance, for the node A, you only need For more information, please read the documentation about inference and don't hesitate to come back to us. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Thanks for the detailed tutorial on defining a custom node and rules. I followed this example, but encountered some confusion regarding the necessity of the rules.
To investigate this, I commented some of the rules and discovered that the following rule alone seems to be necessary:
Could you please provide an explanation for this? And how can I determine which rules are essential for the custom node? @ThijsvdLaar @bvdmitri @alstat and others. Thanks a lot!
p.s.
The full code is as follows:
And the output is:
Beta Was this translation helpful? Give feedback.
All reactions