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