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