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