C_INFERENCE: Inference package for undirected graphical models

c_inference is released for academic research only under the Lesser General Public License.  This package is a free software as described in the LGPL license.  For purposes other then academic research please contact  Talya Meltzer.

The Package

The package includes the following Matlab-interfaces to the c-code:


An interface to the full inference package, includes several methods for approximate inference: Loopy Belief Propagation, Generalized Belief Propagation, Mean-Field approximation, and 4 monte-carlo sampling methods (Metropolis, Gibbs, Wolff, Swendsen-Wang).

Use "help inference" from Matlab to see all options for usage.

gbp_preprocess.m and gbp.m

These 2 interfaces split Generalized Belief Propagation into the pre-process stage (gbp_preprocess.m) and the inference stage (gbp.m), so the user may use only one of them, or changing some parameters in between.

Use "help gbp_preprocess" and "help gbp" from Matlab.


Run gbp with 2 layers: one with the user defined regions (the factors), and one with the single nodes.


An interface to the simulated-annealing c-code. This code uses Metropolis sampling method, the same one used for inference.

Use "help simulatedAnnealing" from Matlab.



You are also required for Chen Yanover's Matlab sparse cell class


From matlab (6.5 and up):

Enter the directory "c_inference".

For compiling the inference package: run the script "compileInference.m".
Running the script with no arguments will compile all the parts:  c_inference, c_gbp, c_gbp_preprocess, c_factor_gbp. It is possible to compile only some of them, using the input arguments {'inference','gbp','gbp_preprocess','factor_gbp'}. For example:
compileInference('inference') - compile c_inference
compileInference({'gbp','gbp_preprocess'}) - compile c_gbp and c_gbp_preprocess

For compiling the simulated annealing code: run the script "compileSimAnneal.m"

Other Packages

Tamir Hazan's C++ code and Matlab wrapper implementing his Norm-Product Belief Propagation algorithm
Danny Bickson's Matlab source code implementing Gaussian and Non-parametric Belief Propagation

Questions, suggestions, comments and bug report - please send to  Talya Meltzer

Back to Talya Meltzer's home page