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