项目作者: Xovee

项目描述 :
CasFlow, Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction.
高级语言: Python
项目地址: git://github.com/Xovee/casflow.git
创建时间: 2020-05-03T03:04:15Z
项目社区:https://github.com/Xovee/casflow

开源协议:MIT License

下载


CasFlow





This repo provides a reference implementation of CasFlow as described in the paper:

CasFlow: Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction
Xovee Xu, Fan Zhou, Kunpeng Zhang, Siyuan Liu, and Goce Trajcevski
IEEE Transactions on Knowledge and Data Engineering (TKDE), 2021

Basic Usage

Requirements

The code was tested with python 3.9.7, tensorflow 2.9.1, cudatoolkit 11.2, and cudnn 8.1.0. Install the dependencies via Anaconda:

  1. # create virtual environment
  2. conda create --name casflow python=3.9
  3. # activate environment
  4. conda activate casflow
  5. # install tensorflow and other requirements
  6. conda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0
  7. pip install -r requirements.txt

A note from 2024: fu*k tensorflow


If you fail to initialize the GPU

It could be your environment incorrectly loads the system-wide installation of CUDA instead of the version CUDA 11.2. You can follow this to use the 11.2 version temporarily. First, open a new shell window. Then, run the following codes:

shell unset CUDA_HOME unset LD_LIBRARY_PATH export PATH=$CONDA_PREFIX/lib:$PATH export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH

Then you can try using the GPU:
python import tensorflow as tf print(tf.config.list_physical_devices('GPU'))

Run the code

  1. cd ./casflow
  2. # generate information cascades
  3. python gene_cas.py --input=./dataset/sample/
  4. # generate cascade graph and global graph embeddings
  5. python gene_emb.py --input=./dataset/sample/
  6. # run CasFlow model
  7. python casflow.py --input=./dataset/sample/

More running options are described in the codes, e.g.,

  • Using the Weibo dataset: --input=./dataset/weibo/
  • Change observation time: --observation_time=3600

Datasets

See some sample cascades in ./dataset/sample/.

Datasets download link: Google Drive or Baidu Drive (password: 1msd).

The datasets we used in the paper are come from:

Cite

If you find CasFlow useful for your research, please consider citing us 😘:

  1. @article{xu2021casflow,
  2. author = {Xovee Xu and Fan Zhou and Kunpeng Zhang and Siyuan Liu and Goce Trajcevski},
  3. title = {Cas{F}low: Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction},
  4. journal = {IEEE Transactions on Knowledge and Data Engineering (TKDE)},
  5. year = {2021},
  6. volume = {35},
  7. number = {4},
  8. pages={3484-3499},
  9. doi = {10.1109/TKDE.2021.3126475},
  10. }

This paper is an extension of VaCas:

  1. @inproceedings{zhou2020variational,
  2. author = {Fan Zhou and Xovee Xu and Kunpeng Zhang and Goce Trajcevski and Ting Zhong},
  3. title = {Variational Information Diffusion for Probabilistic Cascades Prediction},
  4. booktitle = {IEEE International Conference on Computer Communications (INFOCOM)},
  5. year = {2020},
  6. pages = {1618--1627},
  7. doi = {10.1109/INFOCOM41043.2020.9155359},
  8. }

We also have a survey paper you might be interested:

  1. @article{zhou2021survey,
  2. author = {Fan Zhou and Xovee Xu and Goce Trajcevski and Kunpeng Zhang},
  3. title = {A Survey of Information Cascade Analysis: Models, Predictions, and Recent Advances},
  4. journal = {ACM Computing Surveys},
  5. volume = {54},
  6. number = {2},
  7. year = {2021},
  8. articleno = {27},
  9. numpages = {36},
  10. doi = {10.1145/3433000},
  11. }

Contact

For any questions please open an issue or drop an email to: xovee at live.com