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