Unrolling

<< Click to Display Table of Contents >>

Navigation:  Using SMILE > Dynamic Bayesian networks >

Unrolling

SMILE's inference algorithm for dynamic Bayesian networks (DBNs) converts them to temporary static networks by unrolling them over the time steps and then solves these networks. Results of this inference are copied back into the node values in the original DBNs. This gives SMILE the flexibility of allowing to specify time influences of any order and makes its implementation of DBN uniquely powerful. 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." There are four temporal types of nodes, defined by the following enum:

enum dsl_temporalType { dsl_normalNode, dsl_anchorNode, dsl_terminalNode, dsl_plateNode };

By default, the nodes in the network are set to be dsl_normalNode. By using DSL_network::SetTemporalType you can change their temporal type assignment. In the example model above, the plate nodes are white, the anchor node is green, the terminal node is orange and the blue node is normal. For simplicity, we use only single anchor, terminal, and normal nodes. 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 DSL_network::AddTemporalArc. The number on the tag is a temporal order of an arc. The arcs without the tag were added by DSL_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 DSL_network::UnrollNetwork) over the four time steps specified in the model 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 DSL_network::SetNumberOfSlices. 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 the 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 calling DSL_network::UnrollNetwork. The unrolled network created this way is an independent model, which means that changes made to the DBN after UnrollNetwork call are not propagated into the unrolled network. Any possible modifications of the unrolled network are not copied to the original DBN either.