Compiling a Bayes Net

To compile the active Bayes net, choose Network Compile, or click the image\LighteningTOOL.gif toolbar button.  If they are dimmed then compiling has already been done.  A “junction tree” for fast inference will be built internally.  The default display style for the nodes will be changed to belief-bar, so if the nodes haven’t had their display styles set, then they will be displayed in belief-bar style.

For small nets, the Compile command will seem to perform instantly.  For large nets it may take a few seconds, in which case the progress will be displayed in the Messages window.

Auto-Compile:  If you save a compiled auto-updating net to file, then the next time you open it, Netica will automatically compile it and perform updating.  If the net is not compiled when you save it, then you must compile it as described above when you next open it.  If you wish to read in an auto-compiling net without performing any compiling, hold down the shift key when you open it.

Missing Tables:  It is possible to compile and update nets whose CPTs or utility tables are absent or incomplete.  Netica takes missing entries as uniform probabilities or zero utilities.  If there are missing entries or tables, then while compiling Netica will beep and put a message (#2760) in the Messages window.

Optimized:  Netica also has a Network Compile Optimize command, which spends a long time working out a very efficient structure for the internal junction tree.  As it is working, it displays in the Messages window the memory requirements and projected inference time to do a belief updating with the best structure it has developed so far.  Press the ctrl key and hold down the left mouse button at the same time when you want Netica to stop and use that structure.

The memory requirements it displays are very accurate, but when considering the inference time keep in mind that it is based on doing the inference using the same computer as the one doing the compiling, it assumes the computer has enough RAM memory installed that it doesn't need to use virtual memory, and that it has a large share of the processor time under multitasking.  It also doesn't include the screen redraw time, which depends on how large the Bayes net window is, and on the display style of the nodes.

If you save a Bayes net after an optimized compile, then the next time you open it the quick compile command will give it the optimized structure quickly (as long as you don’t change the net nodes or links in between).

Technical:  For those interested in a technical explanation, the quick compile does a minimum-weight search for a good elimination order, and the optimized compile searches for the best elimination order using a specialized algorithm which is a combination of minimum-weight search and stochastic search (with some facets of multi-start methods, simulated annealing and genetic algorithms).