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