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