Skip to content

hzg0601/debuged-Evolve-GCN

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EvolveGCN EvolveGCN存在两种版本:H版本和O版本。 其中H版本使用GRU为时间序列模型, GRU模型以节点嵌入向量和模型参数为输入,以嵌入向量和模型参数为输出。 相当于以节点嵌入向量为输出,以模型参数为隐状态。 H版本适用于节点具有有效特征的场景。

H版本有两种实现: 第一种是将向量上的GRU扩展到矩阵上; 第二种是将将所有节点嵌入向量汇总为k个代表性向量, 以保持输入的列数量匹配隐状态的数量

O版本以LSTM为时间序列模型, LSTM以模型参数为输入,以模型参数为输出,不再使用节点嵌入向量。 O版本适用于节点没有有效特征,或结构特征起决定性作用的场景。

官方实现对H和O版本的实现都是以GRU为基础,并没有按照论文实现

本项目于仅就elliptic_temporal数据集及node_cls任务进行了debug

This repository contains the code for EvolveGCN: Evolving Graph Convolutional Networks for Dynamic Graphs, published in AAAI 2020.

Data

7 datasets were used in the paper:

Update on elliptic: The box link is no longer valid. Please see the instruction to manually prepare the preprocessed version.

For downloaded data sets please place them in the 'data' folder.

Requirements

  • PyTorch 1.0 or higher
  • Python 3.6

Set up with Docker

This docker file describes a container that allows you to run the experiments on any Unix-based machine. GPU availability is recommended to train the models. Otherwise, set the use_cuda flag in parameters.yaml to false.

Requirements

Installation

1. Build the image

From this folder you can create the image

sudo docker build -t gcn_env:latest docker-set-up/

2. Start the container

Start the container

sudo docker run -ti  --gpus all -v $(pwd):/evolveGCN  gcn_env:latest

This will start a bash session in the container.

Usage

Set --config_file with a yaml configuration file to run the experiments. For example:

python run_exp.py --config_file ./experiments/parameters_example.yaml

Most of the parameters in the yaml configuration file are self-explanatory. For hyperparameters tuning, it is possible to set a certain parameter to 'None' and then set a min and max value. Then, each run will pick a random value within the boundaries (for example: 'learning_rate', 'learning_rate_min' and 'learning_rate_max'). The 'experiments' folder contains one file for each result reported in the EvolveGCN paper.

Setting 'use_logfile' to True in the configuration yaml will output a file, in the 'log' directory, containing information about the experiment and validation metrics for the various epochs. The file could be manually analyzed, alternatively 'log_analyzer.py' can be used to automatically parse a log file and to retrieve the evaluation metrics at the best validation epoch. For example:

python log_analyzer.py log/filename.log

Reference

[1] Aldo Pareja, Giacomo Domeniconi, Jie Chen, Tengfei Ma, Toyotaro Suzumura, Hiroki Kanezashi, Tim Kaler, Tao B. Schardl, and Charles E. Leiserson. EvolveGCN: Evolving Graph Convolutional Networks for Dynamic Graphs. AAAI 2020.

BibTeX entry

Please cite the paper if you use this code in your work:

@INPROCEEDINGS{egcn,
  AUTHOR = {Aldo Pareja and Giacomo Domeniconi and Jie Chen and Tengfei Ma and Toyotaro Suzumura and Hiroki Kanezashi and Tim Kaler and Tao B. Schardl and Charles E. Leiserson},
  TITLE = {{EvolveGCN}: Evolving Graph Convolutional Networks for Dynamic Graphs},
  BOOKTITLE = {Proceedings of the Thirty-Fourth AAAI Conference on Artificial Intelligence},
  YEAR = {2020},
}