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