Skip to content

Commit

Permalink
Merge branch 'structureLearner_revisedKinship' into srw2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
krivard committed Jun 23, 2015
2 parents 47ff65c + ee0794d commit 366e61f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
13 changes: 7 additions & 6 deletions examples/structureLearning/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 $^ >> $@
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
24 changes: 12 additions & 12 deletions examples/structureLearning/tmp_baseline.ppr
Original file line number Diff line number Diff line change
@@ -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)}.

0 comments on commit 366e61f

Please sign in to comment.