Merge branch 'master' of git.tuebingen.mpg.de:libdai
[libdai.git] / ChangeLog
1 git master HEAD
2 ---------------
3
4 * Made all "verbose" properties optional
5 * Unit tests should now also work on WINDOWS
6 * [Stefano Pellegrini] Fixed bug in JTree::findMaximum()
7 * Fixed some bugs in the MatLab interface build system
8 * Fixed a bug in utils/fginfo.cpp
9 * Added utils/uai2fg, a utility to convert the UAI inference competition file
10 formats to the libDAI factor graph file format
11 * utils/createfg now has a new factor type ('ISINGUNIFORM') and the old
12 'ISING' factor type has been renamed to 'ISINGGAUSS'
13 * tests/testdai option "marginals" now has five possible values: NONE
14 outputs no marginals, VAR only variable marginals, FAC only factor
15 marginals, VARFAC both types of marginals, and ALL outputs all
16 marginals calculated by the algorithm.
17 * Improved mf.h/cpp:
18 - Added an "init" option that allows to initialize randomly
19 - Added an "updates" option that allows to choose between standard
20 mean field and "hard-spin" mean field
21 * Improved exactinf.h/cpp:
22 - Added ExactInf::findMaximum()
23 * Improved treeep.h/cpp:
24 - changed TreeEP::construct( const RootedTree& ) into
25 TreeEP::construct( const FactorGraph&, const RootedTree& )
26 - Now also supports disconnected factor graphs
27 * Improved jtree.h/cpp:
28 - changed JTree::construct( const std::vector<VarSet>&, bool ) into
29 JTree::construct( const FactorGraph&, const std::vector<VarSet>&, bool )
30 - changed JTree::GenerateJT( const std::vector<VarSet> & )
31 into JTree::GenerateJT( const FactorGraph &, const std::vector<VarSet> & )
32 - Now also supports disconnected factor graphs
33 - Fixed a bug in JTree::findMaximum() and simplified the code
34 * Improved regiongraph.h/cpp:
35 - Made (previously public) members RegionGraph::G, RegionGraph::ORs,
36 RegionGraph::IRs and RegionGraph::fac2OR protected.
37 - Removed partial constructor RegionGraph::RegionGraph( const FactorGraph& fg )
38 - Added some error checking code
39 - Renamed RegionGraph::calcCountingNumbers() into
40 RegionGraph::calcCVMCountingNumbers() and made it protected, because
41 exposing it to the world serves no purpose.
42 - Added RegionGraph::DAG() accessor which returns a reference to the
43 region graph DAG structure (currently implemented as a BipartiteGraph)
44 - Made RegionGraph::RecomputeORs(), RegionGraph::RecomputeORs( const VarSet& )
45 and RegionGraph::RecomputeOR( size_t ) protected and renamed them by changing
46 the "Recompute" into "recompute", because exposing them to the world serves no
47 purpose.
48 - RegionGraph::WriteToFile( const char* ), RegionGraph::ReadFromFile( const char * )
49 and RegionGraph::printDot( std::ostream& ) incorrectly called their respective
50 FactorGraph ancestor methods; this has been corrected by letting them throw a
51 NOT_IMPLEMENTED exception.
52 - Changed the way a RegionGraph is streamed to an std::ostream.
53 * Improved clustergraph.h/cpp:
54 - Made (previously public) members ClusterGraph::G, ClusterGraph::vars and
55 ClusterGraph::clusters private and added ClusterGraph::bipGraph(),
56 ClusterGraph::vars() and ClusterGraph::clusters() methods which offer
57 read-only access to these members.
58 - Deprecated ClusterGraph::toVector()
59 - Added ClusterGraph::nrVars() method
60 - Renamed ClusterGraph::size() method into ClusterGraph::nrClusters()
61 - Added ClusterGraph::var( size_t ) method
62 - Added ClusterGraph::cluster( size_t ) method
63 * Improved factorgraph.h/cpp:
64 - FactorGraph::clamped() now contains a delta factor for the clamped variable
65 - Renamed FactorGraph::Cliques() into FactorGraph::maximalFactorDomains()
66 - Added FactorGraph::MarkovGraph()
67 - Fixed bug in FactorGraph::clone()
68 - FactorGraph::findVars( const VarSet& ) now returns a SmallSet<size_t>
69 and its argument now has a const-qualifier (which fixes a small bug).
70 - Made (previously public) member FactorGraph::G private and added the
71 FactorGraph::bipGraph() method, which offers read-only access to it.
72 - Deprecated the iterator interface:
73 o FactorGraph::iterator typedef
74 o FactorGraph::const_iterator typedef
75 o FactorGraph::begin() members
76 o FactorGraph::end() members
77 - Deprecated FactorGraph::factor(size_t) which offered write access to a factor
78 because using this functionality in the descendant RegionGraph is dangerous,
79 as the outer regions are not automatically recomputed.
80 * Improved factor.h/cpp:
81 - Fixed bug in min( const TFactor<T> &, const TFactor<T> & )
82 - Fixed bug in max( const TFactor<T> &, const TFactor<T> & )
83 - Added TFactor<T>::takeAbs()
84 - Added TFactor<T>::takeExp()
85 - Added TFactor<T>::takeLog( bool )
86 - Added TFactor<T>::operator-() const
87 - Added TFactor<T>::sumAbs() const
88 - Added TFactor<T>::operator==( const TFactor<T> &y )
89 - Renamed TFactor<T>::states() into TFactor<T>::nrStates()
90 - Added TFactor<T>::get(size_t) and TFactor<T>::set(size_t,T) operators;
91 get() is equivalent to "operator[](size_t) const" and set() should
92 be used instead of the non-const operator[], which has been deprecated
93 * Improved prob.h/cpp:
94 - Deprecated TProb::TProb( TIterator begin, TIterator end, size_t sizeHint=0 )
95 constructor: the sizeHint argument no longer defaults to 0
96 - Deprecated TProb::accumulate( T init, binOp op1, unOp op2 );
97 instead, TProb::accumulateSum( T init, unOp op ) and
98 TProb::accumulateMax( T init, unOp op, bool minimize ) should be used.
99 - Deprecated TProb::NormType and TProb::DistType;
100 ProbNormType and ProbDistType should be used instead.
101 - Added TProb<T>::operator==( const TProb<T> &q )
102 - TProb<T>::accumulate() now also applies op2 to init
103 - Fixed bug by renaming TProb<T>::operator<=() to TProb<T>::operator<()
104 - TProb<T>& operator/= (T x) now yields 0 when dividing by 0
105 - Changed format of TProb<T> when streamed to an ostream
106 - Added TProb<T>::get(size_t) and TProb<T>::set(size_t,T) operators;
107 get() is equivalent to "operator[](size_t) const" and set() should
108 be used instead of the non-const operator[], which has been deprecated
109 - Added TProb<T>::resize(size_t)
110 * Improved index.h/cpp:
111 - Added multifor::reset()
112 * Improved properties.h/cpp:
113 - Renamed PropertySet::Set() -> PropertySet::set()
114 - Renamed PropertySet::Get() -> PropertySet::get()
115 - Renamed PropertySet::GetAs<T>() -> PropertySet::getAs<T>()
116 - Renamed PropertySet::ConvertTo<T>() -> PropertySet::convertTo<T>()
117 - Added PropertySet::size()
118 - Added PropertySet::clear()
119 - Added PropertySet::erase()
120 - Fixed bug in PropertySet::setAsString<T>()
121 * Improved util.h/cpp:
122 - Fixed a bug in rnd_seed()
123 - Removed max( const std::vector<Real> &v )
124 * Improved weightedgraph.h/cpp:
125 - Renamed MaxSpanningTreePrims into MaxSpanningTree
126 - Renamed MinSpanningTreePrims into MinSpanningTree
127 - Added option to MaxSpanningTree and MinSpanningTree for
128 choosing between Prim's algorithm and Kruskal's algorithm
129 - Better error checking in RootedTree constructor
130 - The vertices in DEdge and UEdge are now named "first" and "second"
131 for compatibility with a std::pair<size_t,size_t>
132 - Added GraphEL::GraphEL( const GraphAL& G ) constructor
133 * Improved bipgraph.h/cpp:
134 - Fixed bug in BipartiteGraph::eraseNode1()
135 - Fixed bug in BipartiteGraph::eraseNode2()
136 - Fixed bug in BipartiteGraph::isTree()
137 - Added BipartiteGraph::hasEdge()
138 - Added BipartiteGraph::findNb1()
139 - Added BipartiteGraph::findNb2()
140 - BipartiteGraph::delta1() and BipartiteGraph::delta2() now
141 return a SmallSet<size_t> instead of a vector<size_t>
142 - Added BipartiteGraph::operator==( const BipartiteGraph& )
143 - Added BipartiteGraph( size_t nr1, size_t nr2 ) constructor
144 - Added operator<<( std::ostream&, const BipartiteGraph& )
145 * Improved graph.h/cpp:
146 - Fixed bug in GraphAL::nrEdges()
147 - Fixed bug in GraphAL::addEdge()
148 - Fixed bug in GraphAL::isTree()
149 - Fixed bug in GraphAL::eraseNode()
150 - Fixed bug in GraphAL::printDot()
151 - Fixed bug in createGraphGrid3D()
152 - Fixed bug in createGraphRegular()
153 - Added GraphAL::hasEdge(size_t,size_t)
154 - Added GraphAL::operator==( const GraphAL& )
155 - Added operator<<( std::ostream&, const GraphAL& )
156 * Improved smallset.h/cpp:
157 - The sizeHint argument of the iterator constructor
158 SmallSet::SmallSet( TIterator begin, TIterator end, size_t sizeHint=0 )
159 no longer has a default value in order to avoid confusion with the
160 SmallSet::SmallSet( const T &t1, const T &t2 )
161 constructor.
162 - Added SmallSet::insert( const T& t ) method
163 * Removed RandomDRegularGraph(), please use createGraphRegular() instead
164 * Compressed Makefile
165 * Added unit tests for var, smallset, varset, graph, bipgraph,
166 weightedgraph, enum, util, exceptions, properties, index, prob,
167 factor, factorgraph, clustergraph, regiongraph, daialg, alldai
168 * Added unit testing framework
169 * Added initialization of TRWBP weights by sampling spanning trees
170 * Cleaned up MR code:
171 - rewrote response propagation implementation with help of BBP
172 - now uses GraphAL to represent the Markov graph
173 - miscellaneous smaller cleanups
174 * Fixed bug in BBPCostFunction::operator=() which prevented the desired
175 assignment from happening
176 * [Stefano Pellegrini] Fixed bug in BP[logdomain=1,inference=MAXPROD]
177 * Removed deprecated functionality
178 * Updated ChangeLog for libDAI-0.2.4 (forgot a few entries)
179
180
181 libDAI-0.2.4 (2010-02-11)
182 -------------------------
183
184 New features:
185 * Implemented Tree-Reweighted BP
186 * [Frederik Eaton] Implemented Fractional Belief Propagation
187
188 Miscellaneous improvements:
189 * Improved documentation
190 * [Frederik Eaton] Added constructors for BBPCostFunction
191 * [Frederik Eaton] Added accessor/mutator for the elements of a SmallSet<>
192 * [Frederik Eaton] Added unary minus to TProb<>
193 * [Frederik Eaton] Added Hellinger distance to TProb<>::DistType
194 * [Frederik Eaton] Two small patches for src/jtree.cpp and utils/createfg.cpp
195 * tests/testdai option "marginals" now has three possible values: NONE
196 outputs no marginals, VAR only variable marginals, and ALL outputs all
197 marginals calculated by the algorithm.
198 * Strengthened convergence criteria of various algorithms
199 * Added GraphAL, an adjacency list implementation for graphs,
200 similar to (but simpler than) BipartiteGraph
201 * Added some functionality to create various standard factors
202 (the functions whose names start with "createFactor")
203 * Added examples example_sprinkler_gibbs and example_sprinkler_em
204 * Implemented various heuristics for choosing a variable elimination sequence
205 in JTree
206 * Added BETHE method for GBP/HAK cluster choice
207 * Made alias support official part of the library
208
209 Build system:
210 * Moved platform independent build options into Makefile.ALL
211 * Windows platform now needs Boost 1.37 or higher
212
213 Code cleanup:
214 * Cleaned up utils/createfg and tests/testdai
215 * Cleanup of some duplicate code in BP, FBP, TRWBP
216
217 Interface changes (the old interface is marked obsolete and will be removed in the next release):
218 * Removed obsolete/deprecated stuff
219 * Renamed Graph into GraphEL (for Graph, implemented as Edge List)
220 * Renamed some functions of BipartiteGraph:
221 add1() -> addNode1()
222 erase1() -> eraseNode1()
223 nr1() -> nrNodes1()
224 add2() -> addNode2()
225 erase2() -> eraseNode2()
226 nr2() -> nrNodes2()
227 * Renamed some functions in ClusterGraph:
228 ClusterGraph::eliminationCost() -> ::eliminationCost_MinFill()
229 ClusterGraph::VarElim() -> ClusterGraph::VarElim( sequentialVariableElimination( ElimSeq ) )
230 ClusterGraph::VarElim_MinFill() -> ClusterGraph::VarElim( greedyVariableElimination( eliminationCost_MinFill ) )
231 * Changed interface of one RegionGraph constructor
232 * Renamed "Clamped BP" into "Conditioned BP"
233
234 Bug fixes:
235 * Fixed regression in scripts/regenerate-properties (now all errors are
236 gathered before throwing the exception, as used to be the case)
237 * Fixed FTBFS errors on MACOSX (thanks to Sebastian Riedel for reporting this bug)
238 * [Alexander Schwing] Fixed error in BP that occured with damping
239 and using log-domain updates
240 * Fixed bug in HAK for trivial region graphs (with only one outer region
241 and no inner regions), reported by Alejandro Lage.
242 * Fixed long-standing bug in TreeEP (now, within-loop propagation optimization works)
243
244
245 libDAI-0.2.3 (2009-11-16)
246 -------------------------
247
248 New features:
249 * Complete doxygen documentation (although more detailed documentation still
250 has to be written)
251 * [Charles Vaske] Added parameter learning for conditional probabilities by
252 Expectation Maximization
253 * [Patrick Pletscher] Added SWIG wrapper code for experimental python and
254 octave interfaces
255 * Added Max-Product functionality to JTree
256 * [Frederik Eaton] Added Back-Belief-Propagation
257 * [Frederik Eaton] Added approximate inference method "Clamped Belief Propagation"
258 * [Frederik Eaton] Added approximate inference method "Gibbs sampling"
259
260 Code cleanup:
261 * Updated copyright headers
262 * Cleaned up error handling by introducing the DAI_THROWE macro
263 * Introduced DAI_DEBASSERT macro to abbreviate a common pattern
264 * Replaced the standard assert() macro by DAI_ASSERT, which throws a
265 dai::Exception and is even active if NDEBUG is defined
266 * Removed all the virtual default constructors *::create(), as they are not used
267 * [Frederik Eaton] Removed unnecessary copy constructors and assignment operators
268 * [Frederik Eaton] Change cout to cerr in warnings and error messages
269
270 Miscellaneous improvements:
271 * BipartiteGraph:
272 - Added eraseEdge( size_t n1, size_t n2 )
273 - [Frederik Eaton] Improved documentation of Neighbor
274 * TProb<T>:
275 - Added divided_by(const TProb<T>&) const
276 - Added constructor TProb<T>( const std::vector<S> &v )
277 - Added size_t draw(), which draws a random index
278 - [Frederik Eaton] Added setUniform()
279 - [Frederik Eaton] Added sumAbs()
280 - [Frederik Eaton] Added argmax()
281 - [Giuseppe Passino] Added begin(), end()
282 * TFactor<T>:
283 - [Giuseppe Passino] Added begin(), end()
284 - [Charles Vaske] Added TFactor( const std::vector<Var> &vars, const std::vector<T> &p ),
285 which reorders variables to canonical ordering before storing the table
286 - Added constructor TFactor<T>( const VarSet &vars, const std::vector<S> &v )
287 - Extended functionality of TFactor<T>::operators +,-,+=,-= to handle different VarSets
288 - Added TFactor<T>::maxMarginal (similar to marginal but with max instead of sum)
289 * State:
290 - [Giuseppe Passino] Added prefix ++ operator
291 * Permute:
292 - [Charles Vaske] Added constructor in Permute for canonical variable ordering
293 * FactorGraph:
294 - [Frederik Eaton] Added clampVar()
295 - [Frederik Eaton] Added clampFactor()
296 - [Giuseppe Passino] Added begin(), end()
297 * PropertySet:
298 - Added keys(), for getting all keys
299 - [Frederik Eaton] Added default constructor
300 - [Frederik Eaton] Added constructor from string
301 * InfAlg:
302 - Added setProperties(), getProperties() and printProperties()
303 - [Frederik Eaton] Added beliefV(), beliefF()
304 * ExactInf:
305 - Added calcMarginal(const VarSet &)
306 * HAK:
307 - Added "init" parameter to allow for random initialization
308 * BP:
309 - [Giuseppe Passino] Added findMaximum(), which can be used after running
310 max-product BP to construct a global state with maximum probability
311 * JTree:
312 - Added findMaximum(), which can be used after running
313 max-product JTree to construct a global state with maximum probability
314 * MatLab interface:
315 - MEX file dai now also returns variable and factor beliefs
316 - [Sebastian Nowozin] MEX file dai now also optionally returns the MAP state
317 (only for BP and JTree)
318 * README is now created automatically from doxygen documentation
319 * [Frederik Eaton] Added script for automatically generating properties code (used by CBP and BBP)
320 * [Frederik Eaton] Added newInfAlgFromString to alldai.h/cpp
321 * [Frederik Eaton] Added some utility macros (DAI_PV, DAI_DMSG, DAI_IFVERB)
322 and functions (concat(),rnd()) to util.h
323 * Changed output stream operator<< for Var and VarSet
324 * [Frederik Eaton] Improved parsing code in tests/testdai to allow recursive
325 alias substitutions
326 * [Frederik Eaton] Added useful aliases to aliases.conf
327 * [Giuseppe Passino] Optimised maximum-residual BP by using a reversed ordered
328 set instead of the linear search (which can yield enormous speedups - a
329 factor 500 has been measured on a binary Ising grid with 128x128 variables!)
330 * Added debug assertions to Var which check for inconsistent dimensions of
331 variables with the same labels
332 * toc() now returns POSIX system time with maximum accuracy of microseconds
333 * Exception objects now remember their error code
334 * Examples:
335 - Moved example.cpp to examples/
336 - Added examples/example_bipgraph.cpp
337 - Added examples/example_varset.cpp
338 - Added examples/example_sprinkler.cpp
339 - Added examples/example_permute.cpp
340 - Added python and octave ports for examples/example_sprinkler.cpp
341
342 Build system:
343 * Improved Makefile:
344 - Merged Makefile.win and Makefile.shared into Makefile
345 - Macros DAI_VERSION and DAI_DATE have been introduced,
346 in order to store this information in a central place
347 - Introduced CCNODEBUGFLAGS in Makefile
348 - Switched Makefile.win to GNU Make syntax
349 - [Frederik Eaton] Added TAGS, lib targets to Makefile
350 * Compatibility:
351 - [Peter Gober] libDAI can now be built on Cygwin
352 - [Dan Preston] libDAI can now be built on Mac OS X
353 - Changed regression test so that it also works under Windows
354
355 Interface changes (the old interface is marked obsolete and will be removed in the next release):
356 * Var:
357 - Variable labels are now nonnegative (of type size_t)
358 * VarSet:
359 - Replaced calcState() by non-member calcLinearState()
360 - Replaced calcStates() by non-member calcState()
361 * Permute:
362 - Renamed convert_linear_index into convertLinearIndex
363 * TProb<>:
364 - Replaced log0() by log(true)
365 - Replaced takeLog0() by takeLog(true)
366 - Removed hasNonPositives()
367 - Renamed minVal() to min()
368 - Renamed maxVal() to max()
369 - Renamed totalSum() to sum()
370 * TFactor<>:
371 - Replaced log0() by TFactor<T>::log(true)
372 - Removed divided_by, use operator/ instead
373 - Removed divide, use operator/= instead
374 - Removed partSum(const VarSet&), use marginal(const VarSet&,false) instead
375 - Renamed minVal() to min()
376 - Renamed maxVal() to max()
377 - Renamed totalSum() to sum()
378 * FactorGraph:
379 - Changed clamp and clamp interfaces (the variable to be
380 clamped is now indicated by its index, not as a Var)
381 * RegionGraph:
382 - Renamed Check_Counting_Numbers into checkCountingNumbers
383 - Renamed Calc_Counting_Numbers into calcCountingNumbers
384 * Miscellaneous:
385 - Renamed Treewidth(const FactorGraph &) into boundTreewidth(const FactorGraph &)
386 - Replaced UEdgeVec by Graph
387 - Replaced DEdgeVec by new RootedTree class
388 - Moved functionality of GrowRootedTree() into constructor of RootedTree
389 - Merged calcPairBeliefsNew() into calcPairBeliefs()
390 - Removed calcMarginal2ndO()
391 - Renamed smallSet<T> to SmallSet<T>
392 - Removed class Diffs
393 - [Frederik Eaton] Added backwards compatibility layer for edge interface to
394 BipartiteGraph and FactorGraph (which will be obsoleted soon)
395
396 Bug fixes:
397 * Fixed reversal of min and max in
398 TFactor<T> min( const TFactor<T> &, const TFactor<T> & )
399 TFactor<T> max( const TFactor<T> &, const TFactor<T> & )
400 * [Sebastian Nowozin] Fixed memory leak in MEX file dai
401 * [Frederik Eaton] In PropertySet::getStringAs(), check for typeid(ValueType)
402 before typeid(std::string) (this fixes a strange bug for empty string property)
403 * Added work-around for bug in Boost Graph Library
404 * Fixed bug in MaxSpanningTree (it wrongly assumed that the tree was not empty).
405 * Fixed bug in calcMarginal and calcPairBeliefs where states with zero probability
406 mass were clamped, leading to NaNs or assertion errors (thanks to Dan Preston
407 for reporting this)
408
409
410 libDAI-0.2.2 (2008-09-30)
411 -------------------------
412
413 New features:
414 * Approximate inference methods now report the number of iterations needed.
415 * Added damping to various algorithms to improve convergence properties.
416 * Added more features to utils/createfg for creating factor graphs.
417 * Added ExactInf class for brute force exact inference.
418 * [Giuseppe Pasino] Added "logdomain" property to BP, a boolean that controls
419 whether calculations are done in the log-domain or in the linear domain;
420 doing calculations in the log-domain may help if the numerical range
421 of a double is too small.
422 * [Claudio Lima] Added Max-Product functionality to BP.
423 * Improved documentation.
424
425 Improved architecture:
426 * Added Exceptions framework.
427 * Pervasive change of BipartiteGraph implementation (based on an idea by
428 Giuseppe Passino). BipartiteGraph no longer stores the node properties
429 (former _V1 and _V2), nor does it store a dense adjacency matrix anymore,
430 nor an edge list. Instead, it stores the graph structure as lists of
431 neighboring nodes. This yields a significant memory/speed improvement for
432 large factor graphs, and is more elegant as well. Iterating over neighbors is
433 made easy by using boost::foreach.
434 * Added conditional compilation of inference methods.
435 * VarSet is now implemented using a std::vector<Var> instead of a
436 std::set<Var>, which yields a significant speed improvement. Furthermore,
437 the implementation has been generalized, resulting in the small_set<T> class
438 which can be used to represent sets of small cardinality; VarSet is the
439 specialization with T = Var.
440 * Improved ClusterGraph implementation, yielding significant speedups
441 for the JunctionTree algorithm on large factorgraphs.
442
443 Code cleanup:
444 * Moved everything into namespace "dai".
445 * Renamed DEBUG to DAI_DEBUG to avoid conflicts.
446 * Replaced ENUM2,ENUM3,ENUM4,ENUM5,ENUM6 by single DAI_ENUM macro.
447 * Removed utils/remove_short_loops and matlab/remove_short_loops.
448 * Replaced sub_nb class in mr.h by boost::dynamic_bitset.
449 * Improved index.h:
450 - Renamed Index -> IndexFor
451 - Added some .reserve()'s to IndexFor methods which yields a
452 25% speedup of testregression
453 - Replaced multind by Permute
454 - Added MultiFor
455 - Added State
456 * New funcstionality of factor.h.
457 * Moved Properties and MaxDiff frameworks from InfAlg to each individual
458 inference algorithm, because the Properties framework was not as
459 convenient as I hoped, and not every inference algorithm needs a maxdiff
460 variable. Also, replaced some FactorGraph functionality in InfAlg by a
461 function that returns the FactorGraph. The result is cleaner (less
462 entangled) code.
463 * Removed x2x.
464 * Replaced Complex with real numbers (negative potentials are just too rare
465 to warrant the additional "complexity" :)).
466
467 Miscellaneous improvements:
468 * Now compiles also with MS Visual C++ (thanks to Jiuxiang Hu) and with
469 GCC under cygwin.
470 * Contributions by Peter Gober:
471 - Renamed variable _N in mr.* for compatibility with g++ under cygwin.
472 * Misc contributions by Giuseppe Passino:
473 - removed "using namespace std;" from header files - bad practice;
474 - moved header files in include/dai and sources in src;
475 - changed #ifndefs to GNU style;
476 - added extra warning checks (-W -Wextra) and fixed resulting warnings;
477 - dai::TProb:
478 o removed copy constructor and assignment operators (redundant);
479 o implementation of some methods via STL algorithms;
480 o added methods takeExp, takeLog, takeLog0 for transformation in-place;
481 o explicit constructor (prevents implicit conversion from size_t to TProb);
482 o added operator+,+=,-,-=, with argument T (for calculations in log-scale);
483 * Misc contributions by Christian Wojek:
484 - New FactorGraph constructor that constructs from given ranges of factors
485 and variables;
486 - Optimization of FactorGraph constructors using tr1::unordered_map.
487 * FactorGraph constructors no longer check for short loops (huge speed
488 increase for large factor graphs), nor for negative entries. Also, the
489 normtype is now Prob::NORMPROB by default.
490 * Improved MaxSpanningTreePrims algorithm (uses boost::graph).
491
492 Interface changes:
493 * VarSet::
494 - VarSet::stateSpace() -> nrStates(const VarSet &)
495 - VarSet( const std::set<Var> ) -> VarSet( begin, end, sizeHint=0 )
496 - VarSet( const std::vector<Var> ) -> VarSet( begin, end, sizeHint=0 )
497 - removed bool operator||
498 - operator&&(const VarSet&) -> intersects(const VarSet&)
499 - operator&&(const Var&) -> contains(const Var&)
500 * FactorGraph::
501 - delta(const Var &) -> delta(size_t)
502 - Delta(const Var &) -> Delta(size_t)
503 - makeCavity(const Var &) -> makeCavity(size_t)
504 - vars() -> vars
505 - factors() -> factors
506 - removed MakeFactorCavity(size_t)
507 - removed ExactMarginal(const VarSet &)
508 - removed ExactlogZ()
509 - removed updatedFactor(size_t)
510 - removed _normtype and NormType()
511 - removed hasShortLoops(...) and removeShortLoops(...)
512 - WriteToDotFile(const char *filename) -> printDot( std::ostream& os )
513 - undoProb(size_t) -> restoreFactor(size_t)
514 - saveProb(size_t) -> backupFactor(size_t)
515 - undoProbs(const VarSet &) -> restoreFactors(const VarSet &)
516 - saveProbs(const VarSet &) -> backupFactors(const VarSet &)
517 - ReadFromFile(const char*) returns void (throws on error)
518 - WriteToFile(const char*) returns void (throws on error)
519 - removed hasNegatives()
520 * RegionGraph::
521 - nr_ORs() -> nrORs()
522 - nr_IRs() -> nrIRs()
523 - ORs() -> ORs
524 - IRs() -> IRs
525 * *::Regenerate() -> *::construct()
526 * Renamed Index -> IndexFor
527 * Diffs:
528 - max() -> maxDiff()
529 - max_size() -> maxSize()
530 * Prob::max() -> Prob::maxVal()
531 * Factor::
532 - max() -> maxVal()
533 - part_sum() -> partSum()
534 * toc() in util.h now returns seconds as a double
535 * VarSet::operator&&
536 * Properties -> PropertySet
537
538
539 libDAI-0.2.1 (2008-05-26)
540 -------------------------
541
542 Bugfix release.
543 * added missing cstdio header in util.h
544 * fixed Properties in MR_CLAMPING_* and MR_EXACT_*
545 * added description of the factor graph fileformat
546 * improved Makefile
547
548
549 libDAI-0.2.0 (2006-11-30)
550 -------------------------
551
552 First public release.
553
554
555 0.1.5 (2006-11-30)
556 ------------------
557
558 Regressions
559
560 - tests/testlcbp and tests/testlcbp are broken.
561 - EXACT method does not work anymore.
562 - The Properties framework gives a speed penalty because of the lookup
563 costs involved; inner loops should be optimized.
564
565 General framework
566
567 - DAIAlg is now a template class; typedefs for DAIAlg<FactorGraph> and for
568 DAIAlg<RegionGraph> are provided. In this way, we do not have to write "wrapper"
569 functions to forward functionality from either FactorGraph or RegionGraph
570 to DAIAlg. Functionality like clamping can be implemented in FactorGraph
571 and in RegionGraph and no explicit interface is needed in descendants.
572 - New abstract base class InfAlg added, representing an inference algorithm,
573 from which DAIAlg<T> inherits. This solves the incompatibility problems of
574 DAIAlg<T> for different T (e.g. DAIAlg<FactorGraph> was incompatible with
575 DAIAlg<RegionGraph>). More work is required to reduce code duplication
576 (make FactorGraph part of InfAlg).
577 - Added generic interface (nrVars(), Vars(), nrFactors(), factor(size_t),
578 beliefs(), belief(VarSet &), ...) to InfAlg and descendants.
579 - Added a saveProbs/undoProbs interface to InfAlg and descendants that enables
580 one to save a few factors, modify them (e.g. clamp them), and then restore them
581 to their old values. Undo should also init the corresponding messages / beliefs.
582 This can be used if a given factor graph repeatedly needs to be clamped in
583 different ways and an approximation method is run for each clamping; using the
584 saveProbs/undoProbs can give a significant speed increase.
585 - Switched to a general Properties framework that handles the parameters of
586 all inference methods in a uniform manner. The Properties class is a map of
587 several properties in boost::any objects, indexed by their names (strings).
588 It can read from a stream and write to a stream. It is recursive, in the sense
589 that a Properties object can hold a variable of type Properties as well.
590 - Added a generic way of constructing inference algorithms from a factor graph,
591 name and properties object. Added the newInfAlg function which constructs
592 the requested object. This is used by LCBP, the Matlab interface and the
593 command line (test) interface.
594 - Added a generic enum framework for enum parameters. Although implemented as a
595 hack, it is quite useful in that it drastically simplifies and reduces the
596 amount of code for handling enum parameters.
597 - Provided generic functions for calculating marginals in different ways that
598 work for all approximate inference methods.
599
600 Bugfixes
601
602 - Fixed GBP free energy.
603 - Fixed bug in junctiontree (it didn't init the _vars variable).
604 - Corrected two bugs in operator&& and operator|| in VarSet (they returned
605 the logical NOT of what they should return).
606 - Fixed bug in RegionGraph::RecomputeOR(s).
607 - Fixed bug in utils/create_dreg_fg:
608 graph structure was not random for given parameters (forgot to call srand()).
609 - TreeEP bug workaround: use the complete junction tree instead of a subtree.
610 - Fixed bug in JTree::HUGIN() and JTree:ShaferShenoy() in case of junction tree
611 that consists of one outer region only.
612 - Fixed INIT bug in LCBP2::UpdatePancake().
613 - Fixed MaxDiffs flow (except for MR).
614
615 New functionality
616
617 - HAK supports several default cluster choices:
618 minimal (only factors)
619 delta (Markov blankets)
620 loop (all loops consisting of loops consisting of <loopdepth> or less variables)
621 Only the maximal clusters are used as outer clusters.
622 - Implemented TreeEP. It generalizes the heuristic method described in the
623 Minka & Qi paper for obtaining a tree with the most relevant interactions to
624 higher order interactions. Almost all optimizations described in the Minka & Qi
625 paper are used, except that evidence is passed over the whole tree instead of
626 relevant subsets (the latter is almost implemented but buggy). Also added
627 alternative (worst-case) algorithm that uses a maximum spanning tree on the
628 weighted graph where the weight between neighbours i and j is given by
629 N(psi,i,j), where psi is the product of all the factors involving both i and j
630 (which is an upper bound on the effective interaction between i and j).
631 - Implemented MR (MontanariRizzo) based on Bastian's code, but extended it
632 to be able to handle connectivities larger than 3 (in principle, up to 32).
633 It supports different initialization methods (the original RESPPROP,
634 the CLAMPING method and EXACT which uses JTree) and different update methods
635 (FULL and LINEAR).
636 - Implemented LCBP2, an analogon of LCBP which represents pancakes as little
637 networks and uses some approximate inference method on them for calculating
638 marginals.
639 - Now there are several LCBP variants (LCBP, LCBPI, LCBPJ, LCBPK, LCBPL);
640 LCBPJ works only for pairwise, LCBPK is LCBP improved for higher order
641 interactions and LCBPL is LCBPI improved for higher-order interactions.
642 - Wrote one single program utils/createfg for creating various types of
643 random factor graphs.
644 - Wrote utility to visualize factor graphs using graphviz.
645 (it uses the BOOST Program Options library)
646 - Added fginfo utility that displays some info about a .fg file.
647 - Implemented Factor::strength function that calculates the potential strength
648 N(psi,i,j) between variables i and j as described in cs.IT:0504030
649 - Wrote a general MatLab interface matlab/dai (similar to tests/test);
650 this unified the matlab functions dai, dai_bp, dai_mf, dai_jt, dai_tep, dai_cvm.
651 - Added MATLAB routine that returns contraction matrix A for BP convergence analysis.
652 - Implemented a MATLAB interface ai_potstrength for Factor::strength
653 - Added Martijn's x2x
654
655 Improvements of existing code
656
657 - Reimplemented RegionGraph and descendants: a RegionGraph ISA FactorGraph
658 and also a BipartiteGraph<FRegion,Region>. It now also keeps a map that
659 associates outer region indices to factor indices (no powers yet, this
660 is deemed superfluous) and provides functions to recompute (some of) the
661 outer regions from the factors.
662 - InfAlg descendants run() methods now stop immediately and return NAN in case
663 they detect NANs. Only BP does not do NAN checking for performance reasons.
664 - LCBP now works with factors containing zeroes (by defining x/0 = 0).
665 - HAK, GBP and DoubleLoop now conform to the standards for verbose reporting,
666 timing and convergence criteria.
667 - Implemented logZ() for JTree. It does the calculation during message-passing.
668 - Marginal2ndO now optionally divides by the single node beliefs (to the power n-2);
669 hopefully this will give more accurate approximations.
670 - Marginal and Marginal2ndO (optionally) use the new saveProbs/undoProbs functionality
671 for a faster way of calculating marginals, which does not require a call to init()
672 nor cloning the whole object for each clamping. This leads to a significant speedup.
673 - LCBP (and LCBP2) now have complete flexibility in the specification of the
674 inner method, i.e. the method used to generate the initial cavity approximations.
675 One can pass two strings, a name and a properties string, and LCBP simply invokes
676 newInfAlg to construct the corresponding inference algorithm and uses the generic
677 marginal functions to approximate cavity marginals.
678 - Replaced the global "method" variable by local properties and removed ai.h
679 - Added some methods to Factor (operators *, *=, /, /= with doubles as
680 second argument, operators -, +=, -= with other Factors as second
681 arguments, randomize(), RemoveFirstOrderInteractions) and similar
682 operations to Prob
683 - Moving towards boost::program_options for handling command line arguments
684 (tests/test is done).
685 - Renamed some FactorGraph methods:
686 nr_vars -> nrVars
687 nr_factors -> nrFactors
688 varind -> findVar
689 factorind -> findFactor
690 makeFacCavity -> makeFactorCavity
691 - LCBP_SEQMAXRES has been removed because it did strange things.
692 - Implemented RandomDRegularGraph
693 - Implemented JTree::calcMarginal for marginals that are not confined
694 within one cluster (using cut-set conditioning).
695 - Added isConnected() method to FactorGraph (some methods do not work with
696 disconnected factor graphs).
697 - Pair beliefs are now calculated in a symmetrical way by calcPairBeliefs
698 - Removed single node interaction "correction" code from clamping methods
699 - Removed calcCavityDist and calcCavityDist2ndO
700 - No longer depends on GSL.
701 - Increased portability by combining platform dependant utility functions
702 in util.{h,cpp}.
703 - Wrote *.m files providing help
704
705 Testing framework
706
707 - Made a new and significantly improved testing framework that provides most
708 functionality from the command line.
709 - The basis is provided by tests/test, which uses the newInfAlg functionality
710 and enables the user to easily compare from the command line different
711 inference methods on a given factorgraph. All parameters can be specified.
712 Output consists of CPU time, average and maximum single variable marginal
713 errors, relative logZ error and MaxDiff().
714 - tests/aliases.conf contains aliases for standard combinations of methods
715 and their options (which can be used in tests/test).
716 - tests/large contains several bash/python scripts that create random factor
717 graphs, compare several approximate inference algorithms (using tests/test) and
718 allow for easy visualization of the results using PyX.
719 - Added several .fg files for test purposes to /tests (e.g. two ALARM versions
720 alarm.fg and alarm_bnt.fg; testfast.fg, a 4x4 periodic Ising grid for
721 regression testing).
722 - Added a regression test to the Makefile which is included in the standard
723 target. It compares all inference methods on tests/testfast.fg with the
724 results stored in tests/testfast.out
725
726 Miscellaneous
727
728 - Expanded all tabs to spaces (":set tabstop 4\n:set expandtab\n:retab" in vim)
729 - Experimental MATLAB code added for StarEP approximation on cavity
730 - Renamed project to libDAI and changed directory name accordingly.
731 - Renamed JunctionTree to JTree.
732 - Fixed licensing (now it's officially GPL).
733 - Improved README
734
735
736 revision 252
737 ------------
738
739 Functionality
740 - Added RegionGraph, GBP, CVM and HAK (double-loop).
741 - Added JunctionTree (with two update algorithms, HUGIN and Shafer-Shenoy), which is a
742 RegionGraph.
743 - NormType is now chosen automatically (in case of negative factors, Prob::NORMLINF is used,
744 otherwise the default Prob::NORMPROB is used). Also, in case of negative factors, the
745 RegionGraph constructors assign each Factor to a unique outer region instead of dividing
746 it over all subsuming outer regions. See README for when negative factors are known to work
747 and when not.
748 - FactorGraph::FactorGraph(const vector<Factor>) only gives a warning in case of short loops,
749 it does not automatically merge factors anymore.
750 - Removed BP_SEQMAXRESNOCLEAR (all cavity initialization methods now are implicitly NOCLEAR)
751 - Added MATLAB interface functions ai_readfg, ai_removeshortloops and ai_bp
752 - Added LCBP-III type that should be equivalent to LCBP-II, but can handle zeroes
753 in potentials. Note that it is significantly slower than LCBP-II (and has to be reimplemented
754 such that it does not store the complete pancakes, but represents them as little factor graphs).
755
756 Implementation / code
757 - Made a seperate type WeightedGraph, which until now only implements Prim's
758 maximal spanning tree algorithm and is only used by the junction tree code. It might
759 be good to make it a class somewhere in the future and extend it's interface.
760 - Made a seperate class ClusterGraph, which is only used by the junction tree
761 code. It's main purpose is a graph-theoretical variable elimination algorithm.
762 - Implemented the heuristic "minimum-new-edges-in-clique-graph" for variable elimination.
763 - Massive code cleanup, moving towards "generic" programming style, using
764 multiple inheritance and polymorphism.
765 o BP, LCBP, MF, HAK and JunctionTree now inherit from a common DAIAlg class
766 o Made generic functions Marginal, Marginal2ndO, calcCavityDist, calcCavityDist2ndO, clamp
767 that can be used by FactorGraph-based DAIAlgs.
768 o Created TProb<T> class, which stores a probability vector (without the accompanying indexing
769 and VarSet) and provides functionality for it (which is used by TFactor<T>).
770 o Rewrote the VarSet class. It now caches its statespace(). It now privately inherits from set<Var>.
771 I had to overload the insert methods of set<Var> so that they calculate the new statespace.
772 o Rewrote the TFactor class. The TFactor class now HAS a TProb and HAS a VarSet.
773 - Rewrote BP to use the new TProb<T> interface. Performance of BP improved up to a factor 6 by:
774 o using Prob's instead of Factor's;
775 o splitting the multiplication of the messages into two parts (thanks to Vicenc!);
776 o optimizing the calculation of the beliefs (only the message calculations were optimized till now).
777 o replacing FactorGraph::_nb1 and _nb2 (which were set<size_t>) by vector<size_t>
778 - LCBP now seperately stores cavitydists and pancakes. Added InitPancakes() method
779 that takes the cavitydists and multiplies them with the relevant factors. This
780 resulted in an API change in AI which now accepts and returns initial cavitydists
781 instead of initial pancakes.
782
783 Minor changes
784 - Started writing DoxyGen documentation
785 - Renamed lcptab2fg.m matlab/ai_writefg.m
786 - Moved all matlab stuff to matlab/
787 - More detailed reporting (also reports clocks used).
788 - Marginal and Marginal2ndO now use *differences* in logZ to avoid NaNs.
789 - Improved testing suite.
790 - Removed logreal support.
791 - FactorGraph now also supports input streams and ignores comment lines in .fg files.
792 - Added tests/create_full_fg.cpp and tests/create_ising_fg.cpp which create
793 full and periodic 2D Ising networks according to some command line parameters.
794 - Now logZ really returns logZ instead of -logZ.
795 - Added FactorGraph::WriteToDotFile
796
797
798 0.1.4 (2006-04-13)
799 ------------------
800 - Added file IO routines to read and write factorgraphs.
801 - Added L-infinity normalization for use with (partially) negative factors.
802 - Renamed BetheF, MFF to logZ, which now use complex numbers to be able to
803 handle (partially) negative factors.
804 - Added test suite.
805 - All probabilities are now represented using double instead of LogReal<double>.
806 - Combined Alg and Alg3 into LCBP. Several update schemes possible.
807 - Combined several variants of BP into doBP. Several update schemes possible.
808 Now uses precalculated indices for optimization.
809 - Renamed Node -> Var and Potential -> Factor.
810 - Extensive code cleanup. More use of OO techniques. Changed API.
811 - MaxIter now means maximum number of passes (corresponding to number of
812 _parallel_ updates).
813 - MaxDiff now means the maximum L-infinity distance between the updated and
814 original single variable beliefs, for all AI methods.
815 - Implemented RBP which converges faster than BP for difficult problems.
816 - Now uses method parameter which is a bitmask combining outmethod and inmethod
817 (see ai.h).
818
819
820 0.1.3 (2006-03-22)
821 --------------------
822 - All AI methods now return maxdiff
823 - ai.cpp:
824 o Now returns maxdiffinner and maxdiffouter
825 o New BP2ndO innermethod (estimate only 2nd order cavity interactions)
826 o New InitCav outermethod (only create initial cavity distributions)
827 - bp.cpp:
828 o New CavityDist2ndO which estimates 2nd order cavity interactions
829 - Makefile:
830 o Bugfix: removed dependencies on algwim.*
831
832
833 0.1.2 (2006-02-28)
834 --------------------
835 - Cleaned up alg.cpp (removed Alg2 and its corresponding data structures).
836 - Added the possibility to provide initial cavity distributions as an input
837 argument to ai (not much error checking is done, so be careful).
838 - Potentials2mx now correctly sets the dimensions of the P field (i.e. for
839 the output arguments Q, Q0 of ai).
840 - Removed algwim.* since it does not work.
841
842
843 0.1.1 (2006-02-28)
844 --------------------
845 - The constructors of (Log)FactorGraph and LogFactorGraph from a
846 vector<(Log)Potential> now merge potentials to prevent short loops (of length
847 4) in the factor graph. These are used in ai to construct the factor graphs
848 from the psi argument. If compiled with DEBUG defined, the method calc_nb()
849 of BipGraph checks for the existence of short loops.
850 - Changed calling syntax of ai (now the actual syntax *does* correspond to its
851 description in the help).
852 - ai does not hook cout anymore (which caused weird segfaults).
853 - Fixed a bug in an assert statement in the matlab interface code in ai.cpp.
854 - Removed network.* since it is not useful.
855
856
857 0.1.0 (2006-02-28)
858 --------------------
859 First version worthy of a version number.