Construct a close world dataset Family
and split the dataset in different integrity randomly. Run the following command.
bash init.sh
python GraphRule.py -dataset=DATASET -rule_len=LEN -hc_thr=HC -sc_thr=SC -percent=PER -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
python runs.py -train -test -data=DATASET -gpu=GPU -perfix=PERFIX --valid_steps=STEP
PERFIX
: set the integrity of the dataset in the format of percent_
, like 0.6_
STEP
: do valid every STEP
steps
python run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX
SUBLEN
: set max hops of subgraph from center to edge
python run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX -batch=BATCH -pretrain -desc=DESC
python run.py -dataset=DATASET -subgraph=SUBLEN -perfix=PERFIX -lr=LR -restore=RESTORE
LR
: a little scale number for learning rate, like 0.00003 or less
python runs.py -train -test -data=DATASET -gpu=GPU -perfix=PERFIX --valid_steps=STEP -testGNN ../GPHT/EXPS/DATASET/toKGE_XXX.pt
We refer to the code of HAKE and CompGCN. Thanks for their contributions.