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