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