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