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