Merge branch 'vaske'
[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://www.libdai.org
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
92
93 Why C++?
94 --------
95 Because libDAI is implemented in C++, it is very fast compared with
96 implementations in MatLab (a factor 1000 faster is not uncommon). libDAI does
97 provide a MatLab interface for easy integration with MatLab.
98
99
100 Releases
101 --------
102 Releases can be obtained from www.libdai.org
103 License: GNU Public License v2 (or higher).
104
105 libDAI-0.2 December 1, 2006
106 libDAI-0.2.1 May 26, 2008
107 libDAI-0.2.2 September 30, 2008
108
109
110 Acknowledgments
111 ---------------
112 This work is part of the Interactive Collaborative Information Systems (ICIS)
113 project, supported by the Dutch Ministry of Economic Affairs, grant BSIK03024.
114 I would like to thank Martijn Leisink for providing the basis on which libDAI has been built.
115
116
117 Documentation
118 -------------
119 Some doxygen documentation is available. Install doxygen and use "make doc" to build the
120 documentation. If the documentation is not clear enough, feel free to send me an email
121 (or even better, to improve the documentation!).
122
123 A description of the factor graph (.fg) file format can be found in the file FILEFORMAT.
124
125
126 Compatibility
127 -------------
128 The code has been developed under Debian GNU/Linux with the GCC compiler suite.
129 libDAI compiles successfully with g++ versions 3.4, 4.1, 4.2 and 4.3.
130
131 libDAI has also been successfully compiled with MS Visual Studio 2008 under Windows
132 (but not all build targets are supported yet) and with Cygwin under Windows.
133
134 Finally, libDAI has been compiled successfully on MacOS X.
135
136
137 Quick start (linux/cygwin/Mac OS X)
138 -----------------------------------
139 You need:
140 - a recent version of gcc (at least version 3.4)
141 - GNU make
142 - doxygen
143 - graphviz
144 - recent boost C++ libraries (at least version 1.34, or 1.37 for cygwin)
145
146 On Debian/Ubuntu, you can easily install all these packages with a single command:
147 "apt-get install g++ make doxygen graphviz libboost-dev libboost-graph-dev libboost-program-options-dev"
148 (root permissions needed).
149
150 On Mac OS X (10.4 is known to work), these packages can be installed easily via MacPorts.
151 First, install MacPorts according to the instructions at http://www.macports.org/
152 Then, a simple "sudo port install gmake boost doxygen graphviz"
153 should be enough to install everything that is needed.
154
155 On Cygwin, the prebuilt Cygwin package boost-1.33.1-x is known not to work.
156 You can however obtain the latest boost version (you need at least 1.37.0)
157 from http://www.boost.org/ and compile/install it with:
158
159 ./configure
160 make
161 make install
162
163
164 To build the libDAI source, first copy a template Makefile.* to Makefile.conf
165 (for example, copy Makefile.LINUX to Makefile.conf if you use GNU/Linux).
166 Then, edit the Makefile.conf template to adapt it to your local setup.
167 Especially directories may differ from system to system. Finally, run
168
169 make
170
171 If the build was successful, you can test the example program:
172
173 ./example tests/alarm.fg
174
175 or the more elaborate test program:
176
177 tests/testdai --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
178
179
180 Quick start (Windows)
181 ---------------------
182 You need:
183 - A recent version of MicroSoft Visual Studio (2008 works)
184 - recent boost C++ libraries (version 1.34 or higher)
185 - GNU make (can be obtained from http://gnuwin32.sourceforge.net)
186 For the regression test, you need:
187 - GNU diff, GNU sed (can be obtained from http://gnuwin32.sourceforge.net)
188
189 To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit
190 Makefile.conf to adapt it to your local setup. Finally, run (from the command line)
191
192 make
193
194 If the build was successful, you can test the example program:
195
196 example tests\alarm.fg
197
198 or the more elaborate test program:
199
200 tests\testdai --aliases tests\aliases.conf --filename tests\alarm.fg --methods JTREE_HUGIN BP_SEQMAX