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