Project details for libDAI

Logo libDAI 0.2.5

by jorism - May 9, 2010, 17:23:01 CET [ Project Homepage BibTeX Download ]

view ( today), download ( today ), 20 comments, 0 subscriptions

OverallWhole StarWhole StarWhole StarWhole StarWhole Star
FeaturesWhole StarWhole StarWhole StarWhole StarWhole Star
UsabilityWhole StarWhole StarWhole StarWhole StarWhole Star
DocumentationWhole StarWhole StarWhole StarWhole StarWhole Star
(based on 1 vote)

libDAI is a free/open source C++ library (licensed under GPL 2+) that provides implementations of various (approximate) inference methods for discrete graphical models. libDAI supports arbitrary factor graphs with discrete variables; this includes discrete Markov Random Fields and Bayesian Networks.

The library is targeted at researchers. To be able to use the library, a good understanding of graphical models is needed.

The best way to use libDAI is by writing C++ code that invokes the library; in addition, part of the functionality is accessibly by using the

* command line interface
* (limited) MatLab interface
* (experimental) python interface
* (experimental) octave interface.

libDAI can be used to implement novel (approximate) inference algorithms and to easily compare the accuracy and performance with existing algorithms that have been implemented already.

Currently, libDAI supports the following (approximate) inference methods:

* Exact inference by brute force enumeration;
* Exact inference by junction-tree methods;
* Mean Field;
* Loopy Belief Propagation;
* Tree-Reweighted Belief Propagation;
* Fractional Belief Propagation;
* Tree Expectation Propagation;
* Generalized Belief Propagation;
* Double-loop GBP;
* Various variants of Loop Corrected Belief Propagation;
* Gibbs sampler;
* Conditioned Belief Propagation.

These inference methods can be used to calculate partition sums, marginals over subsets of variables, and MAP states (the joint state of variables that has maximum probability).

In addition, libDAI supports parameter learning of conditional probability tables by Expectation Maximization.

Changes to previous version:

This release adds unit tests covering the low-level part of the library. It also brings various code cleanups, bug fixes, interface changes, a large-scale example, a DAG implementation, file format conversion routines and documentation improvements.

BibTeX Entry: Download
Supported Operating Systems: Cygwin, Linux, Macosx, Windows
Data Formats: Ascii
Tags: Approximate Inference, Bayesian Networks, Factor Graphs, Generalized Belief Propagation, Graphical Models, Junction Tree, Loop Corrections, Loopy Belief Propagation, Markov Random Fields, Mean Field
Archive: download here


Giuseppe Passino (on September 10, 2008, 13:14:13)
I've been using it for a long time. Nice architecture, pretty good features. Some aspects may need optimisation in the implementation. Total lack of documentation makes the use of the library a bit hard at the beginning. The library can be used also as a stand-alone program specifying factors as raw files. This can be useful in case basic inference tasks are required. In this case, the presence of some commented examples makes the use of the program easier.
Joris Mooij (on September 30, 2008, 23:06:23)
I am pleased to announce a new version of libDAI. It features several optimizations of implementation details and improved doxygen documentation.
Joris Mooij (on November 17, 2009, 12:10:26)
I am pleased to announce release 0.2.3 of libDAI, featuring contributions from Frederik Eaton, Charles Vaske and Patrick Pletscher (and myself).
Joris Mooij (on February 11, 2010, 13:12:00)
I am pleased to announce the newest release, 0.2.4, of libDAI, featuring miscellaneous improvements. Most notable improvements are new approximate inference algorithms Fractional Belief Propagation and Tree-Reweighted Belief Propagation.
usman khalid (on March 24, 2010, 08:24:18)
Respected Sir, I want to use libDAI to find the "Exact inference by junction-tree methods" using MATLAB 2008. please tell me the procedure of integrate libDAI with MATLAB and how to use it? Regards
Joris Mooij (on March 24, 2010, 08:55:25)
This is described in detail in the documentation, which can be browsed online on the libDAI homepage, Your question is answered at Best wishes, Joris
usman khalid (on March 28, 2010, 21:14:08)
Thanks a lot sir for your help. I did same as following your above link but I m getting an error. I am using Windows XP OS. Following is the way that I install all the things for libDAI project. 1) First I untar the project with this name "libDAI-0.2.4" in my C drive(where my windows xp installed) 2) I install MicroSoft Visual Studio 2008. 3) Install boost C++ version 1.37. 4) GNU make install from this website: 5) And then I goto the Command Prompt(cmd) of windows and type "make" in this directory "C:\libDAI-0.2.4". But I got error which is "make: g++: Command not found", on the next line "make:*** [test/testdai] Error 127". So kindly inform me if any of my step is wrong to run this project on MATLAB.And my final objective will be build this project and run the Junction Tree commands on MATLAB. Thank you for your kind co-operation. Regards
Joris Mooij (on March 29, 2010, 09:03:06)
You probably did not do the following: 'copy Makefile.WINDOWS Makefile.conf' in the libDAI directory, which configures the build process for Windows/Visual C++. Please follow the steps described at carefully. In particular: "To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit Makefile.conf to adapt it to your local setup. Platform independent build options can be set in Makefile.ALL."
usman khalid (on March 29, 2010, 14:32:23)
Thanks. I edit and make the files Makefile.conf and Makefile.ALL and did the appropriate changes. After doing all necessary things when I type "make" on Command Prompt. I got some errors which I paste below from command prompt window. The error belongs to "cl" command and "bipgraph.obj". Kindly help me out:- C:\libDAI-0.2.4>make cl /Iinclude /IE:\boost_1_42_0 /EHsc -DWINDOWS -DNOMINMAX /Ox /Zi -DDAI_DEBUG -D DAI_WITH_BP -DDAI_WITH_FBP -DDAI_WITH_TRWBP -DDAI_WITH_MF -DDAI_WITH_HAK -DDAI_W ITH_LC -DDAI_WITH_TREEEP -DDAI_WITH_JTREE -DDAI_WITH_MR -DDAI_WITH_GIBBS -DDAI_W ITH_CBP -c src/bipgraph.cpp make: cl: Command not found make: *** [bipgraph.obj] Error 127
Joris Mooij (on March 29, 2010, 14:59:19)
You have to make sure that the Visual Studio compiler ("cl.exe") is in your path. The easiest way to do this is to use the Visual Studio Command Prompt, which is part of the Visual Studio Tools menu (at least for Visual Studio 2008).
usman khalid (on March 29, 2010, 15:44:45)
Thanks a lot sir. I just run it from Visual Studio. Now "cl" resolved but the other error which is I think belongs to boost C++ library. Should I set a path of this library with Visual Studio 2008? Because I download and install Boost C++ 1.42 but I am not sure that this error is because of boost library. The error I am facing now is following: C:\libDAI-0.2.4>make cl /Iinclude /IE:\boost_1_42_0 /EHsc -DWINDOWS -DNOMINMAX /Ox /Zi -DDAI_DEBUG -D DAI_WITH_BP -DDAI_WITH_FBP -DDAI_WITH_TRWBP -DDAI_WITH_MF -DDAI_WITH_HAK -DDAI_W ITH_LC -DDAI_WITH_TREEEP -DDAI_WITH_JTREE -DDAI_WITH_MR -DDAI_WITH_GIBBS -DDAI_W ITH_CBP -c src/bipgraph.cpp Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86 Copyright (C) Microsoft Corporation. All rights reserved. bipgraph.cpp C:\libDAI-0.2.4\include\dai/util.h(25) : fatal error C1083: Cannot open include file: 'boost/foreach.hpp': No such file or directory make: *** [bipgraph.obj] Error 2
Joris Mooij (on March 29, 2010, 16:22:53)
Dear Usman, you have to change all the paths in your Makefile.conf to reflect your local setup, in particular the paths pointing to the boost library should be correct (which probably causes this error message). Since I cannot know where you decide to install your boost libraries, you have to change this yourself in Makefile.conf. Good luck, Joris
usman khalid (on March 29, 2010, 16:38:08)
ok sure Mr. Joris. Thanks very much for your kind co-operation. I am trying my best to figure out all these things to run J Tree on Matlab. Regards
usman khalid (on March 30, 2010, 10:34:57)
If i able to run this project on MATLAB; Can I take any example of small Bayesain Networks (4 or 5 nodes only)and find out its exact inference scheme(using JTree) on MATLAB?
Joris Mooij (on March 30, 2010, 11:08:33)
Yes, you can, an example is given in the documentation:
usman khalid (on March 30, 2010, 13:57:25)
I've been successful in compiling the source files for C++ files and the test files execute without any problem. However currently I'm facing problem interfacing with Matlab. I've done everything given in the documentation. Fyi, I'm using MatLab R2009a. For starters, there are some problem with the makefile switches/flags when using mex and I'm able to resolve that. However I'm facing alot of Linking error from numerous DLLs. I've able to compile matlab.cpp but still stuck at dai.cpp. Is there any makefile specific for matlab that known to works with current matlab? or is possible to obtain compiled matlab binaries? Thank You so much for your help.
Joris Mooij (on March 30, 2010, 15:47:22)
Dear Usman, I am sorry to hear that after all your persistence you still haven't succeeded in building the MatLab interface under Windows. I have not tested the build configuration for MatLab under Windows - I only know that it works under GNU/Linux (out-of-the box, in my case). If you figure out the relevant flags and build options, please let me know, then I will update the Makefile.WINDOWS accordingly. I cannot easily test this myself as my virtual Windows environment currently does not have enough diskspace for installing MatLab. I may look at it in the near future. Good luck, Joris
Joris Mooij (on April 1, 2010, 21:55:12)
Dear Usman, I've installed MatLab under Windows and eventually, after a lot of trial and error, found the right compiler flags and build magic. Windows seems to be a rather tricky development environment... Anyway, the current libDAI development snapshot, available at;a=snapshot;h=81c153484a31d9c0b5d69ebe36edf4996670e5e5;sf=tgz should work; for me it works under Windows XP with Visual Studio 2008, MatLab R2008b and Boost 1.42.0. Best, Joris
Joris Mooij (on May 9, 2010, 17:25:45)
For those of you trying to build libDAI under Windows: this should now again work as advertised. Please consider using the Google group "libDAI" at for getting support and discussing development issues (instead of this forum).
simon shao (on August 20, 2010, 08:15:21)

Leave a comment

You must be logged in to post comments.