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