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