-The following people have contributed to libDAI (in order of importance):
+The following people have contributed to libDAI (in decreasing order of importance):
Joris Mooij
Martijn Leisink
Jiuxiang Hu
Peter Gober
Sebastian Nowozin
-Alexander Gerhard Schwing
+Alexander Schwing
+Alejandro Lage
This work is part of the Interactive Collaborative Information Systems (ICIS)
project, supported by the Dutch Ministry of Economic Affairs, grant BSIK03024.
-* Documented and cleaned up utils/createfg
+libDAI-0.2.4 (2010-02-11)
+-------------------------
+
+New features:
+* Implemented Tree-Reweighted BP
+* [Frederik Eaton] Implemented Fractional Belief Propagation
+
+Miscellaneous improvements:
+* Improved documentation
+* [Frederik Eaton] Added constructors for BBPCostFunction
+* [Frederik Eaton] Added accessor/mutator for the elements of a SmallSet<>
+* [Frederik Eaton] Added unary minus to TProb<>
+* [Frederik Eaton] Added Hellinger distance to TProb<>::DistType
+* [Frederik Eaton] Two small patches for src/jtree.cpp and utils/createfg.cpp
+* tests/testdai option "marginals" now has three possible values: NONE
+ outputs no marginals, VAR only variable marginals, and ALL outputs all
+ marginals calculated by the algorithm.
+* Strengthened convergence criteria of various algorithms
* Added GraphAL, an adjacency list implementation for graphs,
similar to (but simpler than) BipartiteGraph
-* Renamed Graph into GraphEL (for Graph, implemented as Edge List)
* Added some functionality to create various standard factors
(the functions whose names start with "createFactor")
-* Renamed "Clamped BP" into "Conditioned BP"
-* Improved documentation
-* Documented tests/testdai
-* Moved platform independent build options into Makefile.ALL
-* Windows platform now needs boost 1.37 or higher
-* Implemented Tree-Reweighted BP
+* Added examples example_sprinkler_gibbs and example_sprinkler_em
* Implemented various heuristics for choosing a variable elimination sequence
in JTree
* Added BETHE method for GBP/HAK cluster choice
+
+Build system:
+* Moved platform independent build options into Makefile.ALL
+* Windows platform now needs Boost 1.37 or higher
+
+Code cleanup:
+* Cleaned up utils/createfg and tests/testdai
+
+Interface changes (the old interface is marked obsolete and will be removed in the next release):
+* Removed obsolete/deprecated stuff
+* Renamed Graph into GraphEL (for Graph, implemented as Edge List)
* Renamed some functions of BipartiteGraph:
add1() -> addNode1()
erase1() -> eraseNode1()
add2() -> addNode2()
erase2() -> eraseNode2()
nr2() -> nrNodes2()
-* Added examples example_sprinkler_gibbs and example_sprinkler_em
-* Strengthened convergence criteria of various algorithms
-* Implemented FBP::logZ()
-* Fixed bug in HAK for trivial region graphs (with only one outer region
- and no inner regions), reported by Alejandro Lage.
-* tests/testdai option "marginals" now has three possible values: NONE
- outputs no marginals, VAR only variable marginals, and ALL outputs all
- marginals calculated by the algorithm.
-* [Frederik Eaton] Added Fractional Belief Propagation
-* [Alexander Gerhard Schwing] Fixed error in BP that occured with damping
- and using log-domain updates
-* Fixed FTBFS errors on MACOSX (thanks to Sebastian Riedel for reporting this bug)
-* [Frederik Eaton] Two small patches for src/jtree.cpp and utils/createfg.cpp
+* Renamed some functions in ClusterGraph:
+ ClusterGraph::eliminationCost() -> ::eliminationCost_MinFill()
+ ClusterGraph::VarElim() -> ClusterGraph::VarElim( sequentialVariableElimination( ElimSeq ) )
+ ClusterGraph::VarElim_MinFill() -> ClusterGraph::VarElim( greedyVariableElimination( eliminationCost_MinFill ) )
+* Changed interface of one RegionGraph constructor
+* Renamed "Clamped BP" into "Conditioned BP"
+
+Bug fixes:
* Fixed regression in scripts/regenerate-properties (now all errors are
gathered before throwing the exception, as used to be the case)
-* [Frederik Eaton] Added constructors for BBPCostFunction
-* [Frederik Eaton] Added accessor/mutator for the elements of a SmallSet<>
-* [Frederik Eaton] Added unary minus to TProb<>
-* [Frederik Eaton] Added Hellinger distance to TProb<>::DistType
-* Some small modifications to AUTHORS and main page of documentation
-* Removed obsolete/deprecated stuff
+* Fixed FTBFS errors on MACOSX (thanks to Sebastian Riedel for reporting this bug)
+* [Alexander Schwing] Fixed error in BP that occured with damping
+ and using log-domain updates
+* Fixed bug in HAK for trivial region graphs (with only one outer region
+ and no inner regions), reported by Alejandro Lage.
libDAI-0.2.3 (2009-11-16)
include Makefile.conf
# Set version and date
-DAI_VERSION="git HEAD"
-DAI_DATE="February 4, 2010 - or later"
+DAI_VERSION="0.2.4"
+DAI_DATE="February 11, 2010"
# Directories of libDAI sources
# Location libDAI headers
WITH_CBP=true
# Build doxygen documentation?
-WITH_DOC=true
+WITH_DOC=
# Build with debug info?
DEBUG=true
# Flags to add in non-debugging mode (if DEBUG=false)
CCNODEBUGFLAGS=/Ox
# Standard include directories
-CCINC=/Iinclude /IC:\boost_1_36_0
+CCINC=/Iinclude /IE:\boost_1_42_0
# LINKER
# Standard libraries to include
LIBS=/link $(LIB)/libdai$(LE)
# For linking with the BOOST Program Options library
-BOOSTLIBS=/LIBPATH:C:\boost_1_36_0\stage\lib
+BOOSTLIBS=/LIBPATH:E:\boost_1_42_0\stage\lib
# Additional library search paths for linker
# (For some reason, we have to add the VC library path, although it is in the environment)
CCLIB=/LIBPATH:"C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB" /LIBPATH:"C:\Program Files\Microsoft Visual Studio 9.0\VC\LIB" /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib"
# Location of Python header files
INCLUDE_PYTHON=C:\python2.5
# Location of Boost C++ library header files
-INCLUDE_BOOST=C:\boost_1_36_0
+INCLUDE_BOOST=E:\boost_1_42_0
-------------------------------------------------------------------------------
-Version: git HEAD
-Date: February 4, 2010 - or later
+Version: 0.2.4
+Date: February 11, 2010
See also: http://www.libdai.org
-------------------------------------------------------------------------------
* mention this software in the Acknowledgements section.
An appropriate citation would be:
-J. M. Mooij (2009) "libDAI 0.2.3: A free/open source C++ library for Discrete
-Approximate Inference", http://www.libdai.org
+
+Joris M. Mooij et al. (2010) "libDAI 0.2.4: A free/open source C++ library for
+Discrete Approximate Inference", http://www.libdai.org
+
+or in BiBTeX format:
+
+ @misc{mooij2010libdai,
+ author = "Joris M. Mooij et al.",
+ title = "lib{DAI} 0.2.4: A free/open source {C}++ library for {D}iscrete {A}pproximate {I}nference",
+ howpublished = "http://www.libdai.org/",
+ year = 2010
+ }
+
Moreover, as a personal note, I would appreciate it if you would email
-(citations of) papers referencing this work to joris dot mooij at libdai dot
-org.
+(citations of) papers referencing this work to joris dot mooij at libdai dot org.
-------------------------------------------------------------------------------
The Google group "libDAI" (http://groups.google.com/group/libdai) can be used
for getting support and discussing development issues.
-
-------------------------------------------------------------------------------
Building libDAI under UNIX variants (Linux / Cygwin / Mac OS X)
+Preparations
+
You need:
* a recent version of gcc (at least version 3.4)
make install
+Building libDAI
+
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
examples/example tests/alarm.fg
-or the more elaborate test program:
+or the more extensive test program:
tests/testdai --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX
Building libDAI under Windows
+Preparations
+
You need:
* A recent version of MicroSoft Visual Studio (2008 is known to work)
* GNU diff, GNU sed (can be obtained from http://gnuwin32.sourceforge.net)
+Building libDAI
+
To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit
Makefile.conf to adapt it to your local setup. Platform independent build
options can be set in Makefile.ALL. Finally, run (from the command line)
examples\example tests\alarm.fg
-or the more elaborate test program:
+or the more extensive test program:
tests\testdai --aliases tests\aliases.conf --filename tests\alarm.fg --methods JTREE_HUGIN BP_SEQMAX
to build the documentation. If the documentation is not clear enough, feel free
to send me an email (or even better, to improve the documentation and send a
patch!). The documentation can also be browsed online at http://www.libdai.org.
-
/** \mainpage Reference manual for libDAI - A free/open source C++ library for Discrete Approximate Inference methods
- * \author Joris Mooij
- * \version git HEAD
- * \date February 4, 2010 - or later
+ * \author Joris Mooij, Frederik Eaton
+ * \version 0.2.4
+ * \date February 11, 2010
*
* <hr size="1">
* \section about About libDAI
* - mention this software in the Acknowledgements section.
*
* An appropriate citation would be:\n
- * J. M. Mooij (2009) "libDAI 0.2.3: A free/open source C++ library for Discrete
+ *
+ * Joris M. Mooij et al. (2010) "libDAI 0.2.4: A free/open source C++ library for Discrete
* Approximate Inference", http://www.libdai.org
*
+ * or in BiBTeX format:
+ *
+ * <pre>
+ * \@misc{mooij2010libdai,
+ * author = "Joris M. Mooij et al.",
+ * title = "lib{DAI} 0.2.4: A free/open source {C}++ library for {D}iscrete {A}pproximate {I}nference",
+ * howpublished = "http://www.libdai.org/",
+ * year = 2010
+ * }
+ * </pre>
+ *
* Moreover, as a personal note, I would appreciate it if you would email
* (citations of) papers referencing this work to joris dot mooij at libdai dot org.
*/
* <hr size="1">
* \section build-unix Building libDAI under UNIX variants (Linux / Cygwin / Mac OS X)
*
+ * \subsection build-unix-preparations Preparations
+ *
* You need:
* - a recent version of gcc (at least version 3.4)
* - GNU make
* make install
* </pre>
*
+ * \subsection build-unix-libdai Building libDAI
+ *
* 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.
*
* If the build is successful, you can test the example program:
* <pre> examples/example tests/alarm.fg</pre>
- * or the more elaborate test program:
+ * or the more extensive test program:
* <pre> tests/testdai --aliases tests/aliases.conf --filename tests/alarm.fg --methods JTREE_HUGIN BP_SEQMAX</pre>
*
*
* <hr size="1">
* \section build-windows Building libDAI under Windows
*
+ * \subsection build-windows-preparations Preparations
+ *
* You need:
* - A recent version of MicroSoft Visual Studio (2008 is known to work)
* - recent boost C++ libraries (version 1.37 or higher)
* For the regression test, you need:
* - GNU diff, GNU sed (can be obtained from http://gnuwin32.sourceforge.net)
*
+ * \subsection build-windows-libdai Building libDAI
+ *
* To build the source, copy Makefile.WINDOWS to Makefile.conf. Then, edit
* Makefile.conf to adapt it to your local setup. Platform independent
* build options can be set in Makefile.ALL. Finally, run (from the command line)
*
* If the build is successful, you can test the example program:
* <pre> examples\\example tests\\alarm.fg</pre>
- * or the more elaborate test program:
+ * or the more extensive test program:
* <pre> tests\\testdai --aliases tests\\aliases.conf --filename tests\\alarm.fg --methods JTREE_HUGIN BP_SEQMAX</pre>
*
*
};
-/// \deprecated Please use GraphEL instead.
+/// \deprecated Please use dai::GraphEL instead.
typedef GraphEL Graph;
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* warranty. See the file COPYING for more details.
*
* Copyright (C) 2008 Frederik Eaton [frederik at ofb dot net]
+ * Copyright (C) 2008-2010 Joris Mooij [joris dot mooij at libdai dot org]
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* warranty. See the file COPYING for more details.
*
* Copyright (C) 2007 Bastian Wemmenhove
- * Copyright (C) 2007-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2007-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
int main( int argc, char *argv[] ) {
if( argc != 3 ) {
- cout << "Usage: " << argv[0] << " <in.fg> <out.dot>" << endl << endl;
- cout << "Converts a .fg (FactorGraph) file to a .dot (GraphViz) file for" << endl;
- cout << "visualization. The .dot file can be converted to .ps (PostScript) by" << endl;
+ // Display help message if number of command line arguments is incorrect
+ cout << "This program is part of libDAI - http://www.libdai.org/" << endl << endl;
+ cout << "Usage: ./fg2dot <in.fg> <out.dot>" << endl << endl;
+ cout << "Converts a libDAI factor graph file to a GraphViz .dot file for visualization." << endl;
+ cout << "The .dot file can be converted to .ps (PostScript) by" << endl;
cout << "'neato -T ps out.dot > out.ps' or by 'dot -T ps out.dot > out.ps'" << endl << endl;
return 1;
} else {
// Read factorgraph
FactorGraph fg;
char *infile = argv[1];
-
fg.ReadFromFile( infile );
+ // Open output file for writing (except if filename equals "-")
ostream *os = &cout;
ofstream outfile;
if( string( argv[2] ) != "-" ) {
return 1;
}
os = &outfile;
- }
+ } // else, write to cout
+ // Write the .dot file
fg.printDot( *os );
return 0;
* 2, or (at your option) any later version. libDAI is distributed without any
* warranty. See the file COPYING for more details.
*
- * Copyright (C) 2006-2009 Joris Mooij [joris dot mooij at libdai dot org]
+ * Copyright (C) 2006-2010 Joris Mooij [joris dot mooij at libdai dot org]
* Copyright (C) 2006-2007 Radboud University Nijmegen, The Netherlands
*/
int main( int argc, char *argv[] ) {
if( argc != 3 ) {
- cout << "Usage: " << argv[0] << " <in.fg> <tw>" << endl << endl;
- cout << "Reports some characteristics of the .fg network." << endl;
+ // Display help message if number of command line arguments is incorrect
+ cout << "This program is part of libDAI - http://www.libdai.org/" << endl << endl;
+ cout << "Usage: ./fginfo <in.fg> <tw>" << endl << endl;
+ cout << "Reports some detailed information about the factor graph <in.fg>." << endl;
cout << "Also calculates treewidth (which may take some time) unless <tw> == 0." << endl;
return 1;
} else {
int calc_tw = atoi(argv[2]);
fg.ReadFromFile( infile );
+ // Output various statistics
cout << "Number of variables: " << fg.nrVars() << endl;
cout << "Number of factors: " << fg.nrFactors() << endl;
cout << "Connected: " << fg.isConnected() << endl;
cout << "Has negatives: " << hasNegatives(fg.factors()) << endl;
cout << "Binary variables? " << fg.isBinary() << endl;
cout << "Pairwise interactions? " << fg.isPairwise() << endl;
+ // Calculate treewidth using various heuristics, if requested
if( calc_tw ) {
std::pair<size_t,size_t> tw;
tw = boundTreewidth(fg, &eliminationCost_MinNeighbors);
tw = boundTreewidth(fg, &eliminationCost_WeightedMinFill);
cout << "Treewidth (WeightedMinFill): " << tw.first << " (" << tw.second << " states)" << endl;
}
+ // Calculate total state space
long double stsp = 1.0;
for( size_t i = 0; i < fg.nrVars(); i++ )
stsp *= fg.var(i).states();
cout << "Total state space: " << stsp << endl;
+ // Output type of factor graph
+ cout << "Type: " << (fg.isPairwise() ? "pairwise" : "higher order") << " interactions, " << (fg.isBinary() ? "binary" : "nonbinary") << " variables" << endl;
+ // Calculate complexity for LCBP
long double cavsum_lcbp = 0.0;
long double cavsum_lcbp2 = 0.0;
size_t max_Delta_size = 0;
cout << it->first << "(" << it->second << ") ";
cout << endl;
- cout << "Type: " << (fg.isPairwise() ? "pairwise" : "higher order") << " interactions, " << (fg.isBinary() ? "binary" : "nonbinary") << " variables" << endl;
-
+ // Calculate girth and length of loops
if( fg.isPairwise() ) {
bool girth_reached = false;
size_t loopdepth;
cout << "Girth: infinity" << endl;
}
+ // Output factor state spaces
map<size_t,size_t> facsizes;
for( size_t I = 0; I < fg.nrFactors(); I++ ) {
size_t Isize = fg.factor(I).vars().size();