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