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