Added CBP to README and to doxygen front page.
[libdai.git] / README
1 libDAI - A free/open source C++ library for Discrete Approximate Inference methods
2 ==================================================================================
3
4 v 0.2.2 - September 30, 2008
5
6
7 Copyright (C) 2006-2008 Joris Mooij [joris dot mooij at tuebingen dot mpg dot de]
8 Radboud University Nijmegen, The Netherlands /
9 Max Planck Institute for Biological Cybernetics, Germany
10
11 with contributions from:
12
13 Martijn Leisink
14 Giuseppe Passino
15 Frederik Eaton
16 Bastian Wemmenhove
17 Christian Wojek
18 Claudio Lima
19 Jiuxiang Hu
20 Peter Gober
21 Patrick Pletscher
22
23
24 ----------------------------------------------------------------------------------
25 This file is part of libDAI.
26
27 libDAI is free software; you can redistribute it and/or modify
28 it under the terms of the GNU General Public License as published by
29 the Free Software Foundation; either version 2 of the License, or
30 (at your option) any later version.
31
32 libDAI is distributed in the hope that it will be useful,
33 but WITHOUT ANY WARRANTY; without even the implied warranty of
34 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 GNU General Public License for more details.
36
37 You should have received a copy of the GNU General Public License
38 along with libDAI; if not, write to the Free Software
39 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
40 ----------------------------------------------------------------------------------
41
42
43 SCIENTISTS: If you write a scientific paper describing research that made
44 substantive use of this program, please (a) mention the fashion in which
45 this software was used, including the version number, with a citation
46 to the literature, to allow replication; (b) mention this software in the
47 Acknowledgements section. The appropriate citation is:
48
49 J. M. Mooij (2008) "libDAI 0.2.2: A free/open source C++ library for Discrete
50 Approximate Inference methods", http://mloss.org/software/view/77/.
51
52 Moreover, as a personal note, I would appreciate it if you would email me with
53 citations of papers referencing this work so I can mention them to my funding
54 agent and tenure committee.
55
56
57 About libDAI
58 ------------
59 libDAI is a free/open source C++ library (licensed under GPL) that provides
60 implementations of various (approximate) inference methods for discrete
61 graphical models. libDAI supports arbitrary factor graphs with discrete
62 variables; this includes discrete Markov Random Fields and Bayesian Networks.
63
64 The library is targeted at researchers; to be able to use the library, a good
65 understanding of graphical models is needed.
66
67
68 Limitations
69 -----------
70 libDAI is not intended to be a complete package for approximate inference.
71 Instead, it should be considered as an "inference engine", providing various
72 inference methods. In particular, it contains no GUI, currently only supports
73 its own file format for input and output (although support for standard file
74 formats may be added later), and provides very limited visualization
75 functionalities.
76
77
78 Features
79 --------
80 Currently, libDAI supports the following (approximate) inference methods:
81
82 * Exact inference by brute force enumeration;
83 * Exact inference by junction-tree methods;
84 * Mean Field;
85 * Loopy Belief Propagation [KFL01];
86 * Tree Expectation Propagation [MiQ04];
87 * Generalized Belief Propagation [YFW05];
88 * Double-loop GBP [HAK03];
89 * Various variants of Loop Corrected Belief Propagation [MoK07, MoR05];
90 * Gibbs sampler;
91 * Conditioned BP [EaG09].
92
93
94 Why C++?
95 --------
96 Because libDAI is implemented in C++, it is very fast compared with
97 implementations in MatLab (a factor 1000 faster is not uncommon). libDAI does
98 provide a MatLab interface for easy integration with MatLab.
99
100
101 Releases
102 --------
103 Releases can be obtained from http://mloss.org/software/view/77/
104 License: GNU Public License v2 (or higher).
105
106 libDAI-0.2 December 1, 2006
107 libDAI-0.2.1 May 26, 2008
108 libDAI-0.2.2 September 30, 2008
109
110
111 Acknowledgments
112 ---------------
113 This work is part of the Interactive Collaborative Information Systems (ICIS)
114 project, supported by the Dutch Ministry of Economic Affairs, grant BSIK03024.
115 I would like to thank Martijn Leisink for providing the basis on which libDAI has been built.
116
117
118 Documentation
119 -------------
120 Some doxygen documentation is available. Install doxygen and use "make doc" to build the
121 documentation. If the documentation is not clear enough, feel free to send me an email
122 (or even better, to improve the documentation!).
123
124 A description of the factor graph (.fg) file format can be found in the file FILEFORMAT.
125
126
127 Compatibility
128 -------------
129 The code has been developed under Debian GNU/Linux with the GCC compiler suite.
130 libDAI compiles successfully with g++ versions 3.4, 4.1, 4.2 and 4.3.
131
132 libDAI has also been successfully compiled with MS Visual Studio 2008 under Windows
133 (but not all build targets are supported yet) and with Cygwin under Windows.
134
135 Finally, libDAI has been compiled successfully on MacOS X.
136
137
138 Quick start (linux/cygwin/Mac OS X)
139 -----------------------------------
140 You need:
141 - a recent version of gcc (at least version 3.4)
142 - GNU make
143 - doxygen
144 - graphviz
145 - recent boost C++ libraries (at least version 1.34, or 1.37 for cygwin)
146
147 On Debian/Ubuntu, you can easily install all these packages with a single command:
148 "apt-get install g++ make doxygen graphviz libboost-dev libboost-graph-dev libboost-program-options-dev"
149 (root permissions needed).
150
151 On Mac OS X (10.4 is known to work), these packages can be installed easily via MacPorts.
152 First, install MacPorts according to the instructions at http://www.macports.org/
153 Then, a simple "sudo port install gmake boost doxygen graphviz"
154 should be enough to install everything that is needed.
155
156 On Cygwin, the prebuilt Cygwin package boost-1.33.1-x is known not to work.
157 You can however obtain the latest boost version (you need at least 1.37.0)
158 from http://www.boost.org/ and compile/install it with:
159
160 ./configure
161 make
162 make install
163
164
165 To build the libDAI source, first copy a template Makefile.* to Makefile.conf
166 (for example, copy Makefile.LINUX to Makefile.conf if you use GNU/Linux).
167 Then, edit the Makefile.conf template to adapt it to your local setup.
168 Especially directories may change from system to system. Finally, run
169
170 make
171
172 If the build was successful, you can test the example program:
173
174 ./example tests/alarm.fg
175
176 or the more elaborate test program:
177
178 tests/testdai --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
179
180
181 Quick start (Windows)
182 ---------------------
183 You need:
184 - A recent version of MicroSoft Visual Studio (2008 works)
185 - recent boost C++ libraries (version 1.34 or higher)
186 - GNU make (can be obtained from http://gnuwin32.sourceforge.net)
187 For the regression test, you need:
188 - GNU diff, GNU sed (can be obtained from http://gnuwin32.sourceforge.net)
189
190 To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit
191 Makefile.conf to adapt it to your local setup. Finally, run (from the command line)
192
193 make
194
195 If the build was successful, you can test the example program:
196
197 example tests\alarm.fg
198
199 or the more elaborate test program:
200
201 tests\testdai --aliases tests\aliases.conf --filename tests\alarm.fg --methods JTREE_HUGIN BP_SEQMAX