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