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