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