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