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