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