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