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