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