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