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