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