bash init.sh
-
CFamily
python RuleTensor-TSP/GraphRule_close.py -dataset=DATASET -rule_len=LEN -hc_thr=HC -sc_thr=SC -percent=0.8 -gpu=GPU -
Wiki79k and Wiki143k
python RuleTensor-TSP/GraphRule_open.py -dataset=DATASET -rule_len=LEN -hc_thr=HC -sc_thr=SC -percent=0.8 -gpu=GPU-DATASET: choose the dataset in
DATA/
-LEN: set the length of rule
-HC: set the head coverage threshold of rule
-SC: set the standard confidence threshold of rule
-PER: set the integrity of the dataset
-GPU: -1 for cpu, otherwise the gpu id
-
CFamily
python KGE-TSP/run_close.py -train -test -data=DATASET -gpu=GPU -perfix='0.8_' --model=MODEL --valid_steps=STEP -
Wiki79k and Wiki143k
python KGE-TSP/run_open.py -train -test -data=DATASET -gpu=gpu -perfix='0.8_' --model=MODEL --valid_steps=STEP-MODEL: the choice of KGE model, ['HAKE', 'PairRE']
-PERFIX: set the integrity of the dataset in the format ofpercent_
-STEP: do valid everySTEP
steps
-
generate subgraphs
python GPHT/run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX
-SUBLEN: set max hops of subgraph from center to edge
-
pre-train embeddings
python GPHT/run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX -batch=BATCH -pretrain -desc=DESC
-
train the model
python GPHT/run.py -dataset=DATASET -perfix=PERFIX -lr=LR -restore=RESTORE -batch=1 -epoch=EPOCH -valid_epochs=STEP -score_func=MODEL -minconf=MINCONF
-LR: a little scale number for learning rate, like 0.00003 or less
-MINCONF: selecting the final predicted triples -
predict triples(in
KGE-TSP
)-
CFamily
python KGE-TSP/run_close.py -train -test -data=DATASET -gpu=0 -perfix='0.8_' -testGNN "EXPS/CFamily/toKGE_XXX.pt" -model=MODEL -
Wiki143k and Wiki79k
python KGE-TSP/run_open.py -train -test -data=DATASET -gpu=0 -perfix='0.8_' -testGNN "EXPS/DATASET/toKGE_XXX.pt" -model=MODEL -valid_steps=STEP
-
We refer to the code of HAKE、PairRE and CompGCN. Thanks for their contributions.