Initial commit of libDAI-0.2.1
[libdai.git] / README
1 libDAI - A free/open source C++ library for Discrete Approximate Inference methods
2 ==================================================================================
3
4 v 0.2.1 - May 26, 2008
5
6
7 Copyright (C) 2006-2008 Joris Mooij [j dot mooij at science dot ru dot nl]
8 Radboud University Nijmegen, The Netherlands
9
10
11 ----------------------------------------------------------------------------------
12 This file is part of libDAI.
13
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.
18
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.
23
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 ----------------------------------------------------------------------------------
28
29
30
31 What is libDAI?
32 ---------------
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).
38
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.
44
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
48 inference methods:
49
50 * Mean Field
51 * (Loopy) Belief Propagation
52 * Tree Expectation Propagation
53 * Generalized Belief Propagation
54 * Double-loop GBP
55 * Loop Corrected Approximate Inference
56
57 Exact inference by JunctionTree is also provided.
58
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).
62
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.
66
67
68 Rationale
69 ---------
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.
80
81
82 Releases
83 --------
84 Releases can be obtained from http://www.mbfys.ru.nl/~jorism/libDAI.
85 License: GNU Public License v2 (or higher).
86
87 libDAI-0.2 December 1, 2006
88 libDAI-0.2.1 May 26, 2008
89
90
91 Acknowledgments
92 ---------------
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.
97
98
99 Known issues
100 ------------
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.
104
105
106 Documentation
107 -------------
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):
111
112 BP
113 updates UpdateType SEQFIX,SEQRND,SEQMAX,PARALL
114 tol double
115 maxiter size_t
116 verbose size_t
117 MF
118 tol double
119 maxiter size_t
120 verbose size_t
121 HAK
122 clusters MIN,DELTA,LOOP
123 loopdepth
124 doubleloop bool
125 tol double
126 maxiter size_t
127 verbose size_t
128 JTREE
129 updates UpdateType HUGIN,SHSH
130 verbose size_t
131 MR
132 updates UpdateType FULL,LINEAR
133 inits InitType RESPPROP,CLAMPING,EXACT
134 verbose size_t
135 TREEEP
136 type TypeType ORG,ALT
137 tol double
138 maxiter size_t
139 verbose size_t
140 LC
141 cavity CavityType FULL,PAIR,PAIR2,UNIFORM
142 updates UpdateType SEQFIX,SEQRND(,NONE)
143 reinit bool
144 cavainame string
145 cavaiopts Properties
146 tol double
147 maxiter size_t
148 verbose size_t
149
150
151
152 Quick start
153 -----------
154 You need:
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")
158 - GNU make
159
160 To build the source, edit the Makefile and then run
161
162 make
163
164 If the build was successful, you can test the example program:
165
166 ./example tests/alarm.fg
167
168 or the more elaborate test program:
169
170 tests/test --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
171
172 A description of the factor graph (.fg) file format can be found in the file FILEFORMAT.