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