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