1 libDAI - A free/open source C++ library for Discrete Approximate Inference methods
2 ==================================================================================
7 Copyright (C) 2006-2008 Joris Mooij [j dot mooij at science dot ru dot nl]
8 Radboud University Nijmegen, The Netherlands
11 ----------------------------------------------------------------------------------
12 This file is part of libDAI.
14 libDAI is free software; you can redistribute it and/or modify
15 it under the terms of the GNU General Public License as published by
16 the Free Software Foundation; either version 2 of the License, or
17 (at your option) any later version.
19 libDAI is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
24 You should have received a copy of the GNU General Public License
25 along with libDAI; if not, write to the Free Software
26 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27 ----------------------------------------------------------------------------------
33 libDAI is a free/open source C++ library (licensed under GPL, see the file
34 COPYING for more details) that provides implementations of various
35 (deterministic) approximate inference methods for discrete graphical models.
36 libDAI supports arbitrary factor graphs with discrete variables (this includes
37 discrete Markov Random Fields and Bayesian Networks).
39 libDAI is not intended to be a complete package for approximate inference.
40 Instead, it should be considered as an "inference engine", providing various
41 inference methods. In particular, it contains no GUI, currently only supports
42 its own file format for input and output (although support for standard file
43 formats may be added), and provides no visualization.
45 Because libDAI is implemented in C++, it is very fast compared with e.g. MatLab
46 implementations. libDAI does provide a MatLab interface for easy integration
47 with MatLab. Currently, libDAI supports the following deterministic approximate
51 * (Loopy) Belief Propagation
52 * Tree Expectation Propagation
53 * Generalized Belief Propagation
55 * Loop Corrected Approximate Inference
57 Exact inference by JunctionTree is also provided.
59 Many of these algorithms are not yet available in similar open source software,
60 to the best of the author's knowledge (open source packages supporting both
61 directed and undirected graphical models are Murphy's BNT, Intel's PNL and gR).
63 The library is targeted at researchers; to be able to use the library, a good
64 understanding of graphical models is needed. However, the code will hopefully
65 find its way into real-world applications as well.
70 In my opinion, the lack of open source reference implementations hampers
71 progress in research on approximate inference. Methods differ widely in terms
72 of quality and performance characteristics, which also depend in different ways
73 on various properties of the graphical models. Finding the best approximate
74 inference method for a particular application therefore often requires
75 empirical comparisons. However, implementing and debugging these methods takes
76 a lot of time which could otherwise be spent on research. I hope that this code
77 will aid researchers to be able to easily compare various (existing as well as
78 new) approximate inference methods, in this way accelerating research and
79 stimulating real-world applications of approximate inference.
84 Releases can be obtained from http://www.mbfys.ru.nl/~jorism/libDAI.
85 License: GNU Public License v2 (or higher).
87 libDAI-0.2 December 1, 2006
88 libDAI-0.2.1 May 26, 2008
93 The development reported here is part of the Interactive Collaborative
94 Information Systems (ICIS) project, supported by the Dutch Ministry of Economic
95 Affairs, grant BSIK03024. I would like to thank Martijn Leisink for providing
96 the basis on which libDAI has been built.
101 Due to a bug in GCC 3.3.x and earlier (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20358)
102 it doesn't compile with these versions (it does compile with GCC version 3.4 and higher).
103 Workaround: replace the two NAN's in factor.h causing the error messages by -1.
108 Almost nonexistant. But I'm working on it. In the meantime, I'll provide limited support
109 by email. The following gives an overview of different methods and their properties
110 (can be slightly obsolete):
113 updates UpdateType SEQFIX,SEQRND,SEQMAX,PARALL
122 clusters MIN,DELTA,LOOP
129 updates UpdateType HUGIN,SHSH
132 updates UpdateType FULL,LINEAR
133 inits InitType RESPPROP,CLAMPING,EXACT
136 type TypeType ORG,ALT
141 cavity CavityType FULL,PAIR,PAIR2,UNIFORM
142 updates UpdateType SEQFIX,SEQRND(,NONE)
155 - a recent version of gcc (version 3.4 at least)
156 - the Boost C++ libraries (under Debian/Ubuntu you can install them using
157 "apt-get install libboost-dev libboost-program-options-dev")
160 To build the source, edit the Makefile and then run
164 If the build was successful, you can test the example program:
166 ./example tests/alarm.fg
168 or the more elaborate test program:
170 tests/test --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
172 A description of the factor graph (.fg) file format can be found in the file FILEFORMAT.