Skip to content

LIANGKE23/kdd_2022_code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

preprocess

since we cannot upload large data, we put the data in this link: https://drive.google.com/file/d/1vQXyMP5HeM-UJBOyRDnXO28YbuZMZeLb/view?usp=sharing

to run the code, please download this data and unzip it into the same folder position with the run.py

so we have the folder like:

./data ./run.py ./helper.py ./model ./read_data ./config ./log ./output_test

Dependencies

The key packages are the pytorch,torch-geometric/torch-scatter package. More details of the installation can be refered in https://pytorch.org/ and https://pytorch-geometric.readthedocs.io/en/latest/notes/installation.html

  • Python 3.7
  • ordered-set==4.0.2
  • torch=1.4.0+cu100
  • torch-cluster=1.5.4
  • torch-geometric=1.4.3
  • torch-scatter=2.0.4
  • torch-sparse=0.6.1
  • torch-spline-conv=1.2.0
input data

please put the data folder in the same folder position with the run.py

  • FB15k
  • FB15k-237
  • WN18
  • WN18RR
  • NELL-995

Training model:

commands to run the model:

########################  CompGCN  ######################

#### compgcn nell-995
python run.py -model 'compgcn' -read_setting 'no_negative_sampling' -neg_num 0  -score_func 'conve' -opn 'corr' -data 'NELL-995'   -lr 0.001 -batch 512  -num_workers 3 -gcn_layer 1 -hid_drop 0.3  

#### compgcn fb15k-237
python run.py -model 'compgcn' -read_setting 'no_negative_sampling' -neg_num 0  -score_func 'conve' -opn 'corr' -data 'FB15k-237'   -lr 0.001 -batch 512  -num_workers 3 -gcn_layer 1 -hid_drop 0.3  

#### compgcn wn18rr
python run.py -model 'compgcn' -read_setting 'no_negative_sampling' -neg_num 0  -score_func 'conve' -opn 'corr' -data 'WN18RR'   -lr 0.001 -batch 512  -num_workers 3 -gcn_layer 1 -hid_drop 0.3  

########################  RGCN  ######################
##rgcn nell-995
python run.py   -model 'rgcn' -read_setting 'negative_sampling' -neg_num 10  -score_func 'distmult' -data 'NELL-995' -rgcn_num_blocks 100  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.1 

##rgcn fb15k-237
python run.py   -model 'rgcn' -read_setting 'negative_sampling' -neg_num 10  -score_func 'distmult' -data 'FB15k-237' -rgcn_num_blocks 100  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.1 

##rgcn wn18rr
python run.py   -model 'rgcn' -read_setting 'negative_sampling' -neg_num 10  -score_func 'distmult' -data 'WN18RR' -rgcn_num_blocks 100  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.1 

##rgcn wn18
python run.py   -model 'rgcn' -read_setting 'negative_sampling' -neg_num 10  -score_func 'distmult' -data 'WN18' -rgcn_num_blocks 100  -lr 0.00001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.05 

##rgcn fb15k
python run.py   -model 'rgcn' -read_setting 'negative_sampling' -neg_num 10  -score_func 'distmult' -data 'FB15k' -rgcn_num_blocks 100  -lr 0.0001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 1 -hid_drop 0.1  -init_dim 600 -gcn_dim 600 -k_w 10 -k_h 60 -no_edge_reverse


########################  KBGAT  ######################
##kbgat fb15k-237
python run.py -model 'kbgat'  -read_setting 'no_negative_sampling' -neg_num 0 -score_func 'conve' -data 'FB15k-237'  -lr 0.001 -batch 512  -l2 0. -num_workers 3  -hid_drop 0.3 

##kbgat wn18rr 
python run.py  -model 'kbgat'  -read_setting 'no_negative_sampling' -neg_num 0 -score_func 'conve' -data 'WN18RR'  -lr 0.001 -nheads 8 -batch 512  -l2 0. -num_workers 3  -hid_drop 0.3

## kbgat nell 
python  run.py  -model 'kbgat'  -read_setting 'no_negative_sampling' -neg_num 0  -score_func 'conve' -data 'NELL-995'  -lr 0.001 -nheads 8 -batch 512  -l2 0. -num_workers 3  -hid_drop 0.3  

########################  mlp  ######################
## compgcn-mlp / kbgat-mlp: nell-995
python run.py  -model 'mlp' -read_setting 'no_negative_sampling' -neg_num 0 -score_func 'conve' -data 'NELL-995'  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 1 -hid_drop 0.3 

## compgcn-mlp / kbgat-mlp: fb15k237
python run.py  -model 'mlp' -read_setting 'no_negative_sampling' -neg_num 0 -score_func 'conve' -data 'FB15k-237'  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 1 -hid_drop 0.3  

## compgcn-mlp / kbgat-mlp: wn18rr
python run.py  -model 'mlp' -read_setting 'no_negative_sampling' -neg_num 0 -score_func 'conve' -data 'WN18RR'  -lr 0.001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 1 -hid_drop 0.3  



####rgcn-mlp fb15k-237
python run.py -model 'mlp' -read_setting 'negative_sampling'  -neg_num 10  -score_func 'distmult' -data 'FB15k-237' -lr 0.0001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.1 

####rgcn-mlp wn18
python run.py -model 'mlp' -read_setting 'negative_sampling'  -neg_num 10  -score_func 'distmult' -data 'WN18' -lr 0.0001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 2 -hid_drop 0.05 
  
####rgcn-mlp fb15k
python run.py -model 'mlp' -read_setting 'negative_sampling'  -neg_num 10  -score_func 'distmult' -data 'FB15k' -lr 0.0001 -batch 512  -l2 0. -num_workers 3 -gcn_layer 1 -hid_drop 0.1 -init_dim 600 -gcn_dim 600 -k_w 10 -k_h 60 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%