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