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