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