Giter Club home page Giter Club logo

cfrhne's Introduction

CFRHNE

conda environment configuration

You can configure the environment with the following command.

conda install --yes --file coarse_requirements.txt
conda install --yes --file requirements.txt

run

You can run the program with the following command. Of course, you can also run the program with pycharm. First, you need to use a coarse model to map the high-dimensional features of the graph to discrete vectors, and then use the embedding as input to obtain better embeddings using adversarial learning.

python C:\xxx\coarse_code\coarse.py
python C:\xxx\code\Fine.py

config

We put all hyperparameters and dataset settings in config.py.


coarse model

pos_size = 4                                 #  the number of positive samples
neg_size = 32                                #  the number of negative samples
n_emb = 150                                  #  the dimension of embeddings

walk_len = walk_lens[dataset]                #  the length of walking
restart_ratio = restart[dataset]             #  the Probability of returning to the starting node
top_k = top_ks[dataset]                      #  the limition of node sequences
n_heads = head_set[dataset]                  #  the number of attention heads
walk_NUM = 40                                #  the number of walking

-------------------------------------------------------------------------------------------------------

fine model

batch_size = 32    
lambda_gen = 1e-5                 #  generator Regularization
lambda_dis = 1e-5                 #  discriminator Regularization
n_sample = 16                     #  sample size
lr_gen = 0.0001                   #  the learing rate of generator 
lr_dis = 0.0001                   #  the learing rate of discriminator
n_epoch = 40                      #  the number of training

sig = 1                           #  the variance of the generator Gaussian distribution
walk_num = 6                      #  the number of walking
walk_len = 8                      #  the length of walking

change = 10                       #  Swap high-order low-order samples every 5 times
d_epoch = 15                      #  Number of iterations in discriminator
g_epoch = 7                       #  Number of iterations in generator

inf = 40                          #  The farthest distance between two vectors

data

XX_test_0.2: 20% of the edges in the network are used as the test set for link predtiction, the format is source_node target_node relation_type

XX_train_0.8: 80% of the edges in the network are used as the train set for link predtiction, the format is source_node target_node relation_type

XX_label: The label value of some nodes in the network, the format is id label

link.dat: all edges in network, the format is source_node target_node relation_type

neg_0.2: 20% of the fake edges in the network are used as the test set for link predtiction, the format is source_node target_node relation_type

neg_0.8: 80% of the fake edges in the network are used as the train set for link prediction, the format is source_node target_node relation_type

evaluation

We have written corresponding evaluation methods for each dataset in acm_evaluation.py, aminer_evaluation.py, dblp_evaluation.py and yelp_evaluation.py.

cfrhne's People

Contributors

yinxing avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.