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