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