next up previous
Next: Bibliography Up: 6 Notes on Code Previous: 6.5 Structure Learning


6.6 Inference

The infer/ directory contains code for performing inference. The mainline is in infer.cpp. infer.h contains functions used in infer.cpp that can be shared with other modules. GroundPredicate and GroundClause are the counterparts of Predicate and Clause in logic/. We created separate classes for inference in order to save space since most of the instance variables in Predicate and Clause are not needed during inference, and inference requires us to ground the MLN to create a Markov random field that may take up a lot of memory. MRF represents the Markov random field and contains the code for Gibbs sampling. GelmanConvergenceTest is used to determine convergence during burn-in, and ConvergenceTest is used to determine convergence during Gibbs sampling. MRF also performs MAP inference by calling an external executable maxwalksat. maxwalksat.h contains a wrapper class for that executable. mwsloc.pl is a perl script that writes in maxwalksat.cpp the location of the maxwalksat executable. Memory efficient MAP inference is performed in the class LazyWalkSat (lazywalksat.h/lazywalksat.cpp), based on the MaxWalkSat package of Kautz et al. (1997) [2]. This class uses lwinfo.h as its interface to the database and lwutil.h for various utilities.


next up previous
Next: Bibliography Up: 6 Notes on Code Previous: 6.5 Structure Learning
Marc Sumner 2006-06-26