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