8000 GitHub - wave5418/SALoM: Code of SALoM built on DyGLib
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

wave5418/SALoM

 
 

Repository files navigation

SALoM: Structure Aware Temporal Graph Networks with Long-Short Memory Updater

This is the code repository of paper SALoM: Structure Aware Temporal Graph Networks with Long-Short Memory Updater, built on DyGLib.

Data Preprocess

As we built our work upon DyGLib, most of the used original dynamic graph datasets come from Towards Better Evaluation for Dynamic Link Prediction, which can be downloaded here. Please download them and put them in DG_data folder. The Myket dataset comes from Effect of Choosing Loss Function when Using T-batching for Representation Learning on Dynamic Networks and can be accessed from here. The original and preprocessed files for Myket dataset are included in this repository. We can run preprocess_data/preprocess_data.py for pre-processing the datasets. For example, to preprocess the Wikipedia dataset, we can run the following commands:

cd preprocess_data/
python preprocess_data.py  --dataset_name wikipedia

We can also run the following commands to preprocess all the original datasets at once:

cd preprocess_data/
python preprocess_all_data.py

Executing Scripts

Scripts for Dynamic Link Prediction

Dynamic link prediction could be performed on all thirteen datasets. If you want to load the best model configurations determined by the grid search, please set the load_best_configs argument to True.

Model Training

  • Example of training SALoM on USLegis dataset:
python train_link_prediction.py --dataset_name USLegis --model_name Liquid --num_neighbors 10 --batch_size 10 --num_layers 1 --num_runs 5 --gpu 0

Model Evaluation

Three (i.e., random, historical, and inductive) negative sampling strategies can be used for model evaluation.

  • Example of evaluating SALoM with random negative sampling strategy on USLegis dataset:
python evaluate_link_prediction.py --dataset_name USLegis --model_name Liquid --num_neighbors 10 --batch_size 10 --num_layers 1 --negative_sample_strategy random --num_runs 5 --gpu 0

Scripts for Dynamic Node Classification

Dynamic node classification could be performed on Wikipedia and Reddit (the only two datasets with dynamic labels).

Model Training

  • Example of training SALoM on USLegis dataset:
python train_node_classification.py --dataset_name USLegis --model_name Liquid --num_neighbors 10 --batch_size 10 --num_layers 1 --num_runs 5 --gpu 0

Model Evaluation

  • Example of evaluating SALoM on USLegis dataset:
python evaluate_node_classification.py --dataset_name USLegis --model_name Liquid --num_neighbors 10 --batch_size 10 --num_layers 1 --num_runs 5 --gpu 0

About

Code of SALoM built on DyGLib

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%
0