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