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