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