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