Unrolling

<< Click to Display Table of Contents >>

Navigation:  Using SMILE Wrappers > Dynamic Bayesian networks >

Unrolling

SMILE's inference algorithm for dynamic Bayesian networks converts DBNs (unrolls them over time) to temporary static networks and then solves these networks. Results of this inference are copied back into the node values in the original DBNs. The structure of the following DBN (in GeNIe format) does not represent any real system, it is created just for demonstration purposes.

before-unroll

Different colors of the nodes represent their location relative to the abstract "temporal plate."  By default, the nodes in the network are set to be Network.NodeTemporalType.CONTEMPORAL and is located outside of the plate. By using Network.setNodeTemporalType you can change their temporal type assignment. In the example model above, the plate nodes (Network.NodeTemporalType.PLATE) are white, the anchor node (Network.NodeTemporalType.ANCHOR) is green, the terminal node (Network.NodeTemporalType.TERMINAL) is orange and the blue node is contemporal. For simplicity, we use only single anchor, terminal, and contemporal node. Note the presence of multiple arcs between two plate nodes and the arc linking P1 with itself. Some of the arcs between plate nodes have a tag with a number; these are temporal arcs, which are created by Network.addTemporalArc. The number on the tag is a temporal order of an arc. The arcs without the tag were added by Network.addArc. The result of unrolling the above DBN (this is performed automatically by the DBN inference algorithm; it is possible to create such network with Network.unroll) is the following:

unrolled

To reduce the size of the unrolled network, we changed the number of time steps (slices) from the default value of 10 to 4 with a call to Network.setSliceCount. The colors of the original nodes were carried over to the unrolled model, which is extended by creating new copies of the plate nodes. The structure of this network shows how the temporal arcs are used to express the conditional dependency of plate nodes in time step i on the plate nodes in time step j, where i > j.

Consider the (temporal) arc between P1 and P2 with temporal order 2. It was copied twice to link P1 with P2 (t=2), and P1 (t=1) with P2 (t=3). Note that there is no copy of this arc starting from P1 (t=2), because its child would be in t=2+2=4, and (zero-based) time stops at 3 in our example. On the other hand, all three temporal arcs with temporal order 1 are copied three times. The relationship represented by an arc linking P1 with itself in the DBN is clearly visible between P1 and P1 (t=1), P1 (t=1) and P1 (t=2) and P1 (t=2) and P1 (t=3).

Note the difference between the arcs originating in Contemporal and Anchor nodes. The Anchor node has children only in the initial slice, while the Contemporal node is linked to all time slices. The Terminal node has parents only in the last slice.

To ensure that unrolled network remains a directed acyclic graph, the following arcs are forbidden in DBNs:

from plate nodes to normal and anchor nodes

from terminal nodes to non-terminal nodes

Unrolling is performed automatically during inference. For debug/explanatory purposes it is also possible to obtain an unrolled network by Network.unroll. The unrolled network created this way is an independent model, which means that changes made to the DBN after unroll call are not propagated into the unrolled network.