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