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