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