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