Some improvements to jtree and regiongraph and started work on regiongraph unit tests
[libdai.git] / tests / aliases.conf
index 1078c40..75c4d80 100644 (file)
@@ -1,21 +1,67 @@
-BP_SEQFIX:                      BP[updates=SEQFIX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0]
-BP_SEQRND:                      BP[updates=SEQRND,tol=1e-9,maxiter=10000,verbose=0,logdomain=0]
-BP_SEQMAX:                      BP[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0]
-BP_PARALL:                      BP[updates=PARALL,tol=1e-9,maxiter=10000,verbose=0,logdomain=0]
-BP_SEQFIX_LOG:                  BP[updates=SEQFIX,tol=1e-9,maxiter=10000,verbose=0,logdomain=1]
-BP_SEQRND_LOG:                  BP[updates=SEQRND,tol=1e-9,maxiter=10000,verbose=0,logdomain=1]
-BP_SEQMAX_LOG:                  BP[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=1]
-BP_PARALL_LOG:                  BP[updates=PARALL,tol=1e-9,maxiter=10000,verbose=0,logdomain=1]
+# This file contains reasonable default settings for various inference
+# algorithms in libDAI. Each non-empty line should either be a comment
+# (starting with #) or contain an alias definition in the format
+#
+# alias:    name[key1=val1,key2=val2,...,keyn=valn]
+#
+# where name should be a valid libDAI algorithm name, and the list of
+# its properties (between rectangular brackets) consists of key=value
+# pairs, seperated by spaces. This defines 'alias' as a shortcut for
+# the rest of the line (more precisely, the contents to the right of 
+# the colon and possible whitespace).
+
+
+# --- EXACT -------------------
+
+EXACT:                          EXACT[verbose=0]
+
+# --- BP ----------------------
+
+BP:                             BP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=0]
+BP_SEQFIX:                      BP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=0]
+BP_SEQRND:                      BP[updates=SEQRND,tol=1e-9,maxiter=10000,logdomain=0]
+BP_SEQMAX:                      BP[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0]
+BP_PARALL:                      BP[updates=PARALL,tol=1e-9,maxiter=10000,logdomain=0]
+BP_SEQFIX_LOG:                  BP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=1]
+BP_SEQRND_LOG:                  BP[updates=SEQRND,tol=1e-9,maxiter=10000,logdomain=1]
+BP_SEQMAX_LOG:                  BP[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=1]
+BP_PARALL_LOG:                  BP[updates=PARALL,tol=1e-9,maxiter=10000,logdomain=1]
+MP_SEQFIX:                      BP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=0,inference=MAXPROD]
+MP_SEQRND:                      BP[updates=SEQRND,tol=1e-9,maxiter=10000,logdomain=0,inference=MAXPROD]
+MP_SEQMAX:                      BP[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0,inference=MAXPROD]
+MP_PARALL:                      BP[updates=PARALL,tol=1e-9,maxiter=10000,logdomain=0,inference=MAXPROD]
+MP_SEQFIX_LOG:                  BP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=1,inference=MAXPROD]
+MP_SEQRND_LOG:                  BP[updates=SEQRND,tol=1e-9,maxiter=10000,logdomain=1,inference=MAXPROD]
+MP_SEQMAX_LOG:                  BP[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=1,inference=MAXPROD]
+MP_PARALL_LOG:                  BP[updates=PARALL,tol=1e-9,maxiter=10000,logdomain=1,inference=MAXPROD]
+
+# --- FBP ---------------------
+
+FBP:                            FBP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=0]
+
+# --- TRWBP -------------------
+
+TRWBP:                          TRWBP[updates=SEQFIX,tol=1e-9,maxiter=10000,logdomain=0,nrtrees=0]
+
+# --- JTREE -------------------
 
 JTREE_HUGIN:                    JTREE[updates=HUGIN,verbose=0]
 JTREE_SHSH:                     JTREE[updates=SHSH,verbose=0]
+JTREE_HUGIN_MAP:               JTREE[updates=HUGIN,verbose=0,inference=MAXPROD]
+JTREE_SHSH_MAP:                        JTREE[updates=SHSH,verbose=0,inference=MAXPROD]
+
+# --- MF ----------------------
 
-MF_SEQRND:                      MF[tol=1e-9,maxiter=10000,verbose=0]
+MF_SEQRND:                      MF[tol=1e-9,maxiter=10000]
+
+# --- TREEEP ------------------
 
 TREEEP:                         TREEEP[type=ORG,tol=1e-9,maxiter=10000,verbose=0]
 TREEEPWC:                       TREEEP[type=ALT,tol=1e-9,maxiter=10000,verbose=0]
 
-MR:                             MR[updates=FULL,inits=RESPPROP,verbose=0,tol=1e-9]
+# --- MR ----------------------
+
+MR_DEFAULT:                     MR[updates=FULL,inits=RESPPROP,verbose=0,tol=1e-9]
 MR_RESPPROP_FULL:               MR[updates=FULL,inits=RESPPROP,verbose=0,tol=1e-9]
 MR_RESPPROP_LINEAR:             MR[updates=LINEAR,inits=RESPPROP,verbose=0,tol=1e-9]
 MR_CLAMPING_FULL:               MR[updates=FULL,inits=CLAMPING,verbose=0,tol=1e-9]
@@ -23,37 +69,69 @@ MR_CLAMPING_LINEAR:             MR[updates=LINEAR,inits=CLAMPING,verbose=0,tol=1
 MR_EXACT_FULL:                  MR[updates=FULL,inits=EXACT,verbose=0,tol=1e-9]
 MR_EXACT_LINEAR:                MR[updates=LINEAR,inits=EXACT,verbose=0,tol=1e-9]
 
-LCBP_FULLCAVin_SEQFIX:          LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_FULLCAVin_SEQRND:          LC[cavity=FULL,reinit=1,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_FULLCAVin_NONE:            LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_FULLCAV_SEQFIX:            LC[cavity=FULL,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_FULLCAV_SEQRND:            LC[cavity=FULL,reinit=0,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_FULLCAV_NONE:              LC[cavity=FULL,reinit=0,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAVin_SEQFIX:          LC[cavity=PAIR,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAVin_SEQRND:          LC[cavity=PAIR,reinit=1,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAVin_NONE:            LC[cavity=PAIR,reinit=1,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAV_SEQFIX:            LC[cavity=PAIR,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAV_SEQRND:            LC[cavity=PAIR,reinit=0,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCAV_NONE:              LC[cavity=PAIR,reinit=0,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
+# --- HAK ---------------------
+
+GBP_MIN:                        HAK[doubleloop=0,clusters=MIN,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+GBP_BETHE:                      HAK[doubleloop=0,clusters=BETHE,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+GBP_DELTA:                      HAK[doubleloop=0,clusters=DELTA,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP3:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=3,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP4:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=4,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP5:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=5,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP6:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=6,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP7:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=7,tol=1e-9,maxiter=10000,verbose=0]
+GBP_LOOP8:                      HAK[doubleloop=0,clusters=LOOP,init=UNIFORM,loopdepth=8,tol=1e-9,maxiter=10000,verbose=0]
+
+HAK_MIN:                        HAK[doubleloop=1,clusters=MIN,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+HAK_BETHE:                      HAK[doubleloop=1,clusters=BETHE,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+HAK_DELTA:                      HAK[doubleloop=1,clusters=DELTA,init=UNIFORM,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP3:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=3,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP4:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=4,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP5:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=5,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP6:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=6,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP7:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=7,tol=1e-9,maxiter=10000,verbose=0]
+HAK_LOOP8:                      HAK[doubleloop=1,clusters=LOOP,init=UNIFORM,loopdepth=8,tol=1e-9,maxiter=10000,verbose=0]
+
+# --- LC ----------------------
+
+LCBP_FULLCAVin_SEQFIX:          LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_FULLCAVin_SEQRND:          LC[cavity=FULL,reinit=1,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_FULLCAVin_NONE:            LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_FULLCAV_SEQFIX:            LC[cavity=FULL,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_FULLCAV_SEQRND:            LC[cavity=FULL,reinit=0,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_FULLCAV_NONE:              LC[cavity=FULL,reinit=0,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAVin_SEQFIX:          LC[cavity=PAIR,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAVin_SEQRND:          LC[cavity=PAIR,reinit=1,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAVin_NONE:            LC[cavity=PAIR,reinit=1,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAV_SEQFIX:            LC[cavity=PAIR,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAV_SEQRND:            LC[cavity=PAIR,reinit=0,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIRCAV_NONE:              LC[cavity=PAIR,reinit=0,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAVin_SEQFIX:         LC[cavity=PAIR2,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAVin_SEQRND:         LC[cavity=PAIR2,reinit=1,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAVin_NONE:           LC[cavity=PAIR2,reinit=1,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAV_SEQFIX:           LC[cavity=PAIR2,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAV_SEQRND:           LC[cavity=PAIR2,reinit=0,updates=SEQRND,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
+LCBP_PAIR2CAV_NONE:             LC[cavity=PAIR2,reinit=0,updates=SEQFIX,maxiter=0,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,logdomain=0],tol=1e-9,verbose=0]
 LCBP_UNICAV_SEQFIX:             LC[cavity=UNIFORM,updates=SEQFIX,maxiter=10000,tol=1e-9,verbose=0,cavaiopts=[],cavainame=NONE]
 LCBP_UNICAV_SEQRND:             LC[cavity=UNIFORM,updates=SEQRND,maxiter=10000,tol=1e-9,verbose=0,cavaiopts=[],cavainame=NONE]
-LCBP_PAIR2CAV_SEQFIX:           LC[cavity=PAIR2,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRINTCAV_SEQFIX:         LC[cavity=PAIRINT,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
-LCBP_PAIRCUMCAV_SEQFIX:         LC[cavity=PAIRCUM,reinit=0,updates=SEQFIX,maxiter=10000,cavainame=BP,cavaiopts=[updates=SEQMAX,tol=1e-9,maxiter=10000,verbose=0,logdomain=0],tol=1e-9,verbose=0]
+
 LCTREEEP:                       LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=TREEEP,cavaiopts=[type=ORG,tol=1e-9,maxiter=10000,verbose=0],tol=1e-9,verbose=0]
 LCMF:                           LC[cavity=FULL,reinit=1,updates=SEQFIX,maxiter=10000,cavainame=MF,cavaiopts=[tol=1e-9,maxiter=10000,verbose=0],tol=1e-9,verbose=0]
+LCBP:                           LCBP_FULLCAVin_SEQRND
+
+# --- GIBBS -------------------
+
+GIBBS:                          GIBBS[iters=1000,burnin=100,verbose=0]
+GIBBS_1e1:                      GIBBS[iters=10,burnin=1,verbose=0]
+GIBBS_1e2:                      GIBBS[iters=100,burnin=10,verbose=0]
+GIBBS_1e3:                      GIBBS[iters=1000,burnin=100,verbose=0]
+GIBBS_1e4:                      GIBBS[iters=10000,burnin=1000,verbose=0]
+GIBBS_1e5:                      GIBBS[iters=100000,burnin=10000,verbose=0]
+GIBBS_1e6:                      GIBBS[iters=1000000,burnin=100000,verbose=0]
+GIBBS_1e7:                      GIBBS[iters=10000000,burnin=100000,verbose=0]
+GIBBS_1e8:                      GIBBS[iters=100000000,burnin=100000,verbose=0]
+GIBBS_1e9:                      GIBBS[iters=1000000000,burnin=100000,verbose=0]
+
+# --- CBP ---------------------
 
-GBP_MIN:                        HAK[doubleloop=0,clusters=MIN,tol=1e-9,maxiter=10000,verbose=0]
-GBP_DELTA:                      HAK[doubleloop=0,clusters=DELTA,tol=1e-9,maxiter=10000,verbose=0]
-GBP_LOOP3:                      HAK[doubleloop=0,clusters=LOOP,loopdepth=3,tol=1e-9,maxiter=10000,verbose=0]
-GBP_LOOP4:                      HAK[doubleloop=0,clusters=LOOP,loopdepth=4,tol=1e-9,maxiter=10000,verbose=0]
-GBP_LOOP6:                      HAK[doubleloop=0,clusters=LOOP,loopdepth=6,tol=1e-9,maxiter=10000,verbose=0]
-GBP_LOOP8:                      HAK[doubleloop=0,clusters=LOOP,loopdepth=8,tol=1e-9,maxiter=10000,verbose=0]
-
-HAK_MIN:                        HAK[doubleloop=1,clusters=MIN,tol=1e-9,maxiter=10000,verbose=0]
-HAK_DELTA:                      HAK[doubleloop=1,clusters=DELTA,tol=1e-9,maxiter=10000,verbose=0]
-HAK_LOOP3:                      HAK[doubleloop=1,clusters=LOOP,loopdepth=3,tol=1e-9,maxiter=10000,verbose=0]
-HAK_LOOP4:                      HAK[doubleloop=1,clusters=LOOP,loopdepth=4,tol=1e-9,maxiter=10000,verbose=0]
-HAK_LOOP5:                      HAK[doubleloop=1,clusters=LOOP,loopdepth=5,tol=1e-9,maxiter=10000,verbose=0]
-HAK_LOOP6:                      HAK[doubleloop=1,clusters=LOOP,loopdepth=6,tol=1e-9,maxiter=10000,verbose=0]
-HAK_LOOP8:                      HAK[doubleloop=1,clusters=LOOP,loopdepth=8,tol=1e-9,maxiter=10000,verbose=0]
+CBP:                            CBP[max_levels=12,updates=SEQMAX,tol=1e-9,rec_tol=1e-9,maxiter=500,choose=CHOOSE_RANDOM,recursion=REC_FIXED,clamp=CLAMP_VAR,min_max_adj=1.0e-9,bbp_cfn=CFN_FACTOR_ENT,verbose=0,rand_seed=0,bbp_props=[verbose=0,tol=1.0e-9,maxiter=10000,damping=0,updates=SEQ_BP_REV],clamp_outfile=]
+BBP:                            CBP[choose=CHOOSE_BBP]