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