Martijn Leisink
Giuseppe Passino
+Frederik Eaton
+Charlie Vaske
+Bastian Wemmenhove
Christian Wojek
Claudio Lima
-Bastian Wemmenhove
Jiuxiang Hu
Peter Gober
+Patrick Pletscher
+Sebastian Nowozin
----------------------------------------------------------------------------------
----------------------------------------------------------------------------------
-SCIENTISTS: please be aware that the fact that this program is released as Free
-Software does not excuse you from scientific propriety, which obligates you to
-give appropriate credit! If you write a scientific paper describing research
-that made substantive use of this program, it is your moral obligation as a
-scientist to (a) mention the fashion in which this software was used, including
-the version number, with a citation to the literature, to allow replication;
-(b) mention this software in the Acknowledgements section. The appropriate
-citation is:
+SCIENTISTS: If you write a scientific paper describing research that made
+substantive use of this program, please (a) mention the fashion in which
+this software was used, including the version number, with a citation
+to the literature, to allow replication; (b) mention this software in the
+Acknowledgements section. The appropriate citation is:
J. M. Mooij (2008) "libDAI 0.2.2: A free/open source C++ library for Discrete
-Approximate Inference methods", http://mloss.org/software/view/77/.
+Approximate Inference methods", http://www.libdai.org
Moreover, as a personal note, I would appreciate it if you would email me with
citations of papers referencing this work so I can mention them to my funding
* Tree Expectation Propagation [MiQ04];
* Generalized Belief Propagation [YFW05];
* Double-loop GBP [HAK03];
- * Various variants of Loop Corrected Belief Propagation [MoK07, MoR05].
+ * Various variants of Loop Corrected Belief Propagation [MoK07, MoR05];
+ * Gibbs sampler;
+ * Conditioned BP [EaG09].
+
+In addition, libDAI supports parameter learning of conditional probability
+tables by Expectation Maximization.
Why C++?
--------
Because libDAI is implemented in C++, it is very fast compared with
implementations in MatLab (a factor 1000 faster is not uncommon). libDAI does
-provide a MatLab interface for easy integration with MatLab.
+provide a (limited) MatLab interface for easy integration with MatLab.
Releases
--------
-Releases can be obtained from http://mloss.org/software/view/77/
+Releases can be obtained from www.libdai.org
License: GNU Public License v2 (or higher).
libDAI-0.2 December 1, 2006
libDAI-0.2.1 May 26, 2008
-libDAI-0.2.2 September 30, 2008
+libDAI-0.2.2 September 30, 2008
Acknowledgments
Compatibility
-------------
The code has been developed under Debian GNU/Linux with the GCC compiler suite.
-libDAI compiles successfully with g++ versions 4.1, 4.2 and 4.3.
+libDAI compiles successfully with g++ versions 3.4, 4.1, 4.2 and 4.3.
libDAI has also been successfully compiled with MS Visual Studio 2008 under Windows
-(but not all build targets are supported yet).
+(but not all build targets are supported yet) and with Cygwin under Windows.
+Finally, libDAI has been compiled successfully on MacOS X.
-Quick start (linux/cygwin)
---------------------------
+
+Quick start (linux/cygwin/Mac OS X)
+-----------------------------------
You need:
- a recent version of gcc (at least version 3.4)
- GNU make
- doxygen
- graphviz
-- recent boost C++ libraries (at least version 1.34)
+- recent boost C++ libraries (at least version 1.34, or 1.37 for cygwin)
On Debian/Ubuntu, you can easily install all these packages with a single command:
-"apt-get install g++ make doxygen libboost-dev libboost-graph-dev libboost-program-options-dev"
+"apt-get install g++ make doxygen graphviz libboost-dev libboost-graph-dev libboost-program-options-dev"
(root permissions needed).
-To build the source, edit the Makefile and adapt it to your local setup. Then, run
+On Mac OS X (10.4 is known to work), these packages can be installed easily via MacPorts.
+First, install MacPorts according to the instructions at http://www.macports.org/
+Then, a simple "sudo port install gmake boost doxygen graphviz"
+should be enough to install everything that is needed.
+
+On Cygwin, the prebuilt Cygwin package boost-1.33.1-x is known not to work.
+You can however obtain the latest boost version (you need at least 1.37.0)
+from http://www.boost.org/ and compile/install it with:
+
+ ./configure
+ make
+ make install
+
+
+To build the libDAI source, first copy a template Makefile.* to Makefile.conf
+(for example, copy Makefile.LINUX to Makefile.conf if you use GNU/Linux).
+Then, edit the Makefile.conf template to adapt it to your local setup.
+Especially directories may differ from system to system. Finally, run
make
tests/testdai --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
-Quick start (windows)
+Quick start (Windows)
---------------------
You need:
- A recent version of MicroSoft Visual Studio (2008 works)
- recent boost C++ libraries (version 1.34 or higher)
+- GNU make (can be obtained from http://gnuwin32.sourceforge.net)
+For the regression test, you need:
+- GNU diff, GNU sed (can be obtained from http://gnuwin32.sourceforge.net)
-To build the source, edit the Makefile and adapt it to your local setup. Then, run (from the command line)
+To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit
+Makefile.conf to adapt it to your local setup. Finally, run (from the command line)
- nmake -f Makefile.win
+ make
If the build was successful, you can test the example program:
or the more elaborate test program:
tests\testdai --aliases tests\aliases.conf --filename tests\alarm.fg --methods JTREE_HUGIN BP_SEQMAX
+
+
+Quick start (MatLab)
+--------------------
+You need:
+- MatLab
+- The platform-dependent requirements described above
+
+First, you need to build the libDAI source as described above for your
+platform. By default, the MatLab interface is disabled, so before compiling the
+source, you have to enable it in the Makefile.conf by setting
+"WITH_MATLAB=true". Also, you have to configure the MatLab-specific parts of
+Makefile.conf to match your system (in particular, the Makefile variables ME,
+MATLABDIR and MEX). The MEX file extension depends on your platform; for a
+64-bit linux x86_64 system this would be "ME=.mexa64", for a 32-bit linux x86
+system this would be "ME=.mexglx". If you are unsure about your MEX file
+extension: it needs to be the same as what the MatLab command "mexext" returns.
+The required MEX files are built by issuing
+
+ make
+
+from the command line. The MatLab interface is much less powerful than using
+libDAI from C++. There are two reasons for this: (i) it is boring to write MEX
+files; (ii) the large performance penalty paid when large data structures (like
+factor graphs) have to be converted between their native C++ data structure to
+something that MatLab understands.
+
+A simple example of how to use the MatLab interface is the following (entered
+at the MatLab prompt), which performs exact inference by the junction tree
+algorithm and approximate inference by belief propagation on the ALARM network:
+
+ cd path_to_libdai/matlab
+ [psi] = dai_readfg ('../examples/alarm.fg');
+ [logZ,q,md,qv,qf] = dai (psi, 'JTREE', '[updates=HUGIN,verbose=0]')
+ [logZ,q,md,qv,qf] = dai (psi, 'BP', '[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0]')
+
+where "path_to_libdai" has to be replaced with the directory in which libDAI
+was installed. For other algorithms and their parameters, see
+tests/aliases.conf.