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