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