add social domain benchmark with evidence
This commit is contained in:
parent
51c279d24c
commit
f8e714dcc3
34
packages/CLPBN/benchmarks/smokers_evidence/bp_tests.sh
Executable file
34
packages/CLPBN/benchmarks/smokers_evidence/bp_tests.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
source sm.sh
|
||||
source ../benchs.sh
|
||||
|
||||
SOLVER="bp"
|
||||
|
||||
function run_all_graphs
|
||||
{
|
||||
write_header $1
|
||||
run_solver ev0p$POP $2
|
||||
run_solver ev5p$POP $2
|
||||
run_solver ev10p$POP $2
|
||||
run_solver ev15p$POP $2
|
||||
run_solver ev20p$POP $2
|
||||
run_solver ev25p$POP $2
|
||||
run_solver ev30p$POP $2
|
||||
run_solver ev35p$POP $2
|
||||
run_solver ev40p$POP $2
|
||||
run_solver ev45p$POP $2
|
||||
run_solver ev50p$POP $2
|
||||
run_solver ev55p$POP $2
|
||||
run_solver ev60p$POP $2
|
||||
run_solver ev65p$POP $2
|
||||
run_solver ev70p$POP $2
|
||||
run_solver ev75p$POP $2
|
||||
run_solver ev80p$POP $2
|
||||
run_solver ev85p$POP $2
|
||||
run_solver ev90p$POP $2
|
||||
}
|
||||
|
||||
prepare_new_run
|
||||
run_all_graphs "bp(shedule=seq_fixed) " seq_fixed
|
||||
|
34
packages/CLPBN/benchmarks/smokers_evidence/cbp_tests.sh
Executable file
34
packages/CLPBN/benchmarks/smokers_evidence/cbp_tests.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
source sm.sh
|
||||
source ../benchs.sh
|
||||
|
||||
SOLVER="cbp"
|
||||
|
||||
function run_all_graphs
|
||||
{
|
||||
write_header $1
|
||||
run_solver ev0p$POP $2
|
||||
run_solver ev5p$POP $2
|
||||
run_solver ev10p$POP $2
|
||||
run_solver ev15p$POP $2
|
||||
run_solver ev20p$POP $2
|
||||
run_solver ev25p$POP $2
|
||||
run_solver ev30p$POP $2
|
||||
run_solver ev35p$POP $2
|
||||
run_solver ev40p$POP $2
|
||||
run_solver ev45p$POP $2
|
||||
run_solver ev50p$POP $2
|
||||
run_solver ev55p$POP $2
|
||||
run_solver ev60p$POP $2
|
||||
run_solver ev65p$POP $2
|
||||
run_solver ev70p$POP $2
|
||||
run_solver ev75p$POP $2
|
||||
run_solver ev80p$POP $2
|
||||
run_solver ev85p$POP $2
|
||||
run_solver ev90p$POP $2
|
||||
}
|
||||
|
||||
prepare_new_run
|
||||
run_all_graphs "cbp(shedule=seq_fixed) " seq_fixed
|
||||
|
35
packages/CLPBN/benchmarks/smokers_evidence/fove_tests.sh
Executable file
35
packages/CLPBN/benchmarks/smokers_evidence/fove_tests.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
source sm.sh
|
||||
source ../benchs.sh
|
||||
|
||||
SOLVER="fove"
|
||||
|
||||
function run_all_graphs
|
||||
{
|
||||
write_header $1
|
||||
run_solver ev0p$POP $2
|
||||
run_solver ev5p$POP $2
|
||||
run_solver ev10p$POP $2
|
||||
run_solver ev15p$POP $2
|
||||
run_solver ev20p$POP $2
|
||||
run_solver ev25p$POP $2
|
||||
run_solver ev30p$POP $2
|
||||
run_solver ev35p$POP $2
|
||||
run_solver ev40p$POP $2
|
||||
run_solver ev45p$POP $2
|
||||
run_solver ev50p$POP $2
|
||||
run_solver ev55p$POP $2
|
||||
run_solver ev60p$POP $2
|
||||
run_solver ev65p$POP $2
|
||||
run_solver ev70p$POP $2
|
||||
run_solver ev75p$POP $2
|
||||
run_solver ev80p$POP $2
|
||||
run_solver ev85p$POP $2
|
||||
run_solver ev90p$POP $2
|
||||
}
|
||||
|
||||
prepare_new_run
|
||||
run_all_graphs "fove "
|
||||
|
||||
|
49
packages/CLPBN/benchmarks/smokers_evidence/gen_people.sh
Executable file
49
packages/CLPBN/benchmarks/smokers_evidence/gen_people.sh
Executable file
@ -0,0 +1,49 @@
|
||||
#!/home/tgomes/bin/yap -L --
|
||||
|
||||
:- use_module(library(lists)).
|
||||
:- use_module(library(random)).
|
||||
|
||||
|
||||
:- initialization(main).
|
||||
|
||||
main :-
|
||||
unix(argv(Args)),
|
||||
nth(1, Args, EV), % percentage of evidence
|
||||
nth(2, Args, NP), % number of individuals
|
||||
atomic_concat(['ev', EV, 'p', NP, '.yap'], FileName),
|
||||
open(FileName, 'write', S),
|
||||
atom_number(EV, EV2),
|
||||
atom_number(NP, NP2),
|
||||
EV3 is EV2 / 100.0,
|
||||
generate_people(S, NP2, 4),
|
||||
write(S, '\n'),
|
||||
write(S, 'query(X) :- '),
|
||||
generate_evidence(S, NP2, EV3, 4),
|
||||
write(S, 'friends(p1,p2,X).\n'),
|
||||
close(S).
|
||||
|
||||
|
||||
generate_people(S, N, Counting) :-
|
||||
Counting > N, !.
|
||||
generate_people(S, N, Counting) :-
|
||||
format(S, 'people(p~w).~n', [Counting]),
|
||||
Counting1 is Counting + 1,
|
||||
generate_people(S, N, Counting1).
|
||||
|
||||
|
||||
generate_evidence(S, N, Ev, Counting) :-
|
||||
Counting > N, !.
|
||||
generate_evidence(S, N, Ev, Counting) :-
|
||||
random(X),
|
||||
(
|
||||
X < Ev
|
||||
->
|
||||
random(Y),
|
||||
(Y > 0.5 -> Val = t ; Val = f),
|
||||
format(S, 'smokes(p~w,~w),', [Counting,Val])
|
||||
;
|
||||
true
|
||||
),
|
||||
Counting1 is Counting + 1,
|
||||
generate_evidence(S, N, Ev, Counting1).
|
||||
|
37
packages/CLPBN/benchmarks/smokers_evidence/hve_tests.sh
Executable file
37
packages/CLPBN/benchmarks/smokers_evidence/hve_tests.sh
Executable file
@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
source sm.sh
|
||||
source ../benchs.sh
|
||||
|
||||
SOLVER="hve"
|
||||
|
||||
function run_all_graphs
|
||||
{
|
||||
write_header $1
|
||||
run_solver ev0p$POP $2
|
||||
run_solver ev5p$POP $2
|
||||
run_solver ev10p$POP $2
|
||||
run_solver ev15p$POP $2
|
||||
run_solver ev20p$POP $2
|
||||
run_solver ev25p$POP $2
|
||||
run_solver ev30p$POP $2
|
||||
run_solver ev35p$POP $2
|
||||
run_solver ev40p$POP $2
|
||||
run_solver ev45p$POP $2
|
||||
run_solver ev50p$POP $2
|
||||
run_solver ev55p$POP $2
|
||||
run_solver ev60p$POP $2
|
||||
run_solver ev65p$POP $2
|
||||
run_solver ev70p$POP $2
|
||||
run_solver ev75p$POP $2
|
||||
run_solver ev80p$POP $2
|
||||
run_solver ev85p$POP $2
|
||||
run_solver ev90p$POP $2
|
||||
}
|
||||
|
||||
prepare_new_run
|
||||
run_all_graphs "hve(elim_heuristic=min_neighbors) " min_neighbors
|
||||
#run_all_graphs "hve(elim_heuristic=min_weight) " min_weight
|
||||
#run_all_graphs "hve(elim_heuristic=min_fill) " min_fill
|
||||
#run_all_graphs "hve(elim_heuristic=weighted_min_fill) " weighted_min_fill
|
||||
|
34
packages/CLPBN/benchmarks/smokers_evidence/lbp_tests.sh
Executable file
34
packages/CLPBN/benchmarks/smokers_evidence/lbp_tests.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
source sm.sh
|
||||
source ../benchs.sh
|
||||
|
||||
SOLVER="lbp"
|
||||
|
||||
function run_all_graphs
|
||||
{
|
||||
write_header $1
|
||||
run_solver ev0p$POP $2
|
||||
run_solver ev5p$POP $2
|
||||
run_solver ev10p$POP $2
|
||||
run_solver ev15p$POP $2
|
||||
run_solver ev20p$POP $2
|
||||
run_solver ev25p$POP $2
|
||||
run_solver ev30p$POP $2
|
||||
run_solver ev35p$POP $2
|
||||
run_solver ev40p$POP $2
|
||||
run_solver ev45p$POP $2
|
||||
run_solver ev50p$POP $2
|
||||
run_solver ev55p$POP $2
|
||||
run_solver ev60p$POP $2
|
||||
run_solver ev65p$POP $2
|
||||
run_solver ev70p$POP $2
|
||||
run_solver ev75p$POP $2
|
||||
run_solver ev80p$POP $2
|
||||
run_solver ev85p$POP $2
|
||||
run_solver ev90p$POP $2
|
||||
}
|
||||
|
||||
prepare_new_run
|
||||
run_all_graphs "lbp(shedule=seq_fixed) " seq_fixed
|
||||
|
8
packages/CLPBN/benchmarks/smokers_evidence/sm.sh
Executable file
8
packages/CLPBN/benchmarks/smokers_evidence/sm.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
NETWORK="'../../examples/social_domain2'"
|
||||
SHORTNAME="sm"
|
||||
QUERY="query(X)"
|
||||
|
||||
POP=500
|
||||
|
Reference in New Issue
Block a user