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