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