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