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