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