diff --git a/examples/structureLearning/Makefile b/examples/structureLearning/Makefile index 65d4f716..f74feb72 100644 --- a/examples/structureLearning/Makefile +++ b/examples/structureLearning/Makefile @@ -17,6 +17,7 @@ TSRW=l2p:mu=0.0001:eta=1.0 EPOCHS=100 PROVER=dpr APR=eps=0.0001:alph=0.001 +UNNORMALIZED=--unnormalized --weightingScheme tanh ifeq ($(strip $(ITERS)),) ITERS=10 @@ -70,6 +71,12 @@ clean: structureLearning: $(foreach it,$(wildcard ${NAME}_delta_*.ppr),$(addsuffix $(subst .ppr,.solutions.txt,$(subst _delta,-test.alone,$(it))),pre. post.)) +yww.pre: $(foreach it,$(wildcard ${NAME}_delta_*.ppr),$(addsuffix $(subst .ppr,.yww,$(subst _delta,-test.alone,$(it))),pre.)) + +yww.post: $(foreach it,$(wildcard ${NAME}_delta_*.ppr),$(addsuffix $(subst .ppr,.yww,$(subst _delta,-test.alone,$(it))),post.)) + +yww: yww.pre yww.post + results.txt: $(foreach it,$(wildcard ${NAME}_delta_*.ppr),$(addsuffix $(subst .ppr,.results.txt,$(subst _delta,-test.alone,$(it))),pre. post.)) echo phase.subset.iteration uR mR uMRR mMRR uMAP mMAP > $@ cat $^ >> $@ @@ -121,9 +128,6 @@ results.txt: $(foreach it,$(wildcard ${NAME}_delta_*.ppr),$(addsuffix $(su pre.${NAME}-test.%.solutions.txt: ${NAME}-test.examples ${NAME}_%.wam java ${JOPTS} -cp ${CP} edu.cmu.ml.proppr.QueryAnswerer --programFiles ${NAME}-test.cfacts:$(word 2,$^) --queries $< --solutions $@ --prover ${PROVER} --threads ${THREADS} --apr ${APR} ${UNNORMALIZED} -pre.${NAME}-test.baseline.solutions.txt: ${NAME}-test.examples baseline.wam - java ${JOPTS} -cp ${CP} edu.cmu.ml.proppr.QueryAnswerer --programFiles ${NAME}-test.cfacts:$(word 2,$^) --queries $< --solutions $@ --prover ${PROVER} --threads ${THREADS} --apr ${APR} ${UNNORMALIZED} - # make e.g. post.uml_1-test.h22_01.solutions.txt # from e.g. uml_1-test.examples # uml_1_h22_01.wam @@ -137,9 +141,6 @@ post.${NAME}-test.%.solutions.txt: ${NAME}-test.examples ${NAME}_%.wam params.%. pre.${NAME}-train.%.solutions.txt: ${NAME}-train.examples ${NAME}_%.wam java ${JOPTS} -cp ${CP} edu.cmu.ml.proppr.QueryAnswerer --programFiles ${NAME}-train.cfacts:$(word 2,$^) --queries $< --solutions $@ --prover ${PROVER} --threads ${THREADS} --apr ${APR} ${UNNORMALIZED} -pre.${NAME}-train.baseline.solutions.txt: ${NAME}-train.examples baseline.wam - java ${JOPTS} -cp ${CP} edu.cmu.ml.proppr.QueryAnswerer --programFiles ${NAME}-train.cfacts:$(word 2,$^) --queries $< --solutions $@ --prover ${PROVER} --threads ${THREADS} --apr ${APR} ${UNNORMALIZED} - # make e.g. post.uml_1-train.h22_01.solutions.txt # from e.g. uml_1-train.examples # uml_1_h22_01.wam diff --git a/examples/structureLearning/tmp_baseline.ppr b/examples/structureLearning/tmp_baseline.ppr index f7530468..1fbdb8c8 100644 --- a/examples/structureLearning/tmp_baseline.ppr +++ b/examples/structureLearning/tmp_baseline.ppr @@ -1,12 +1,12 @@ -interp(i_sister,X,Y) :- rel(sister,X,Y). -interp(i_daughter,X,Y) :- rel(daughter,X,Y). -interp(i_wife,X,Y) :- rel(wife,X,Y). -interp(i_father,X,Y) :- rel(father,X,Y). -interp(i_brother,X,Y) :- rel(brother,X,Y). -interp(i_nephew,X,Y) :- rel(nephew,X,Y). -interp(i_son,X,Y) :- rel(son,X,Y). -interp(i_uncle,X,Y) :- rel(uncle,X,Y). -interp(i_niece,X,Y) :- rel(niece,X,Y). -interp(i_mother,X,Y) :- rel(mother,X,Y). -interp(i_aunt,X,Y) :- rel(aunt,X,Y). -interp(i_husband,X,Y) :- rel(husband,X,Y). +interp(i_sister,X,Y) :- rel(sister,X,Y){f(i_sister,if,sister)}. +interp(i_daughter,X,Y) :- rel(daughter,X,Y){f(i_daughter,if,daughter)}. +interp(i_wife,X,Y) :- rel(wife,X,Y){f(i_wife,if,wife)}. +interp(i_father,X,Y) :- rel(father,X,Y){f(i_father,if,father)}. +interp(i_brother,X,Y) :- rel(brother,X,Y){f(i_brother,if,brother)}. +interp(i_nephew,X,Y) :- rel(nephew,X,Y){f(i_nephew,if,nephew)}. +interp(i_son,X,Y) :- rel(son,X,Y){f(i_son,if,son)}. +interp(i_uncle,X,Y) :- rel(uncle,X,Y){f(i_uncle,if,uncle)}. +interp(i_niece,X,Y) :- rel(niece,X,Y){f(i_niece,if,niece)}. +interp(i_mother,X,Y) :- rel(mother,X,Y){f(i_mother,if,mother)}. +interp(i_aunt,X,Y) :- rel(aunt,X,Y){f(i_aunt,if,aunt)}. +interp(i_husband,X,Y) :- rel(husband,X,Y){f(i_husband,if,husband)}.