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