{"id":18283622,"url":"https://github.com/xovee/casflow","last_synced_at":"2025-04-05T07:30:58.431Z","repository":{"id":38919588,"uuid":"260818309","full_name":"Xovee/casflow","owner":"Xovee","description":"TKDE 2021. CasFlow: Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction.","archived":false,"fork":false,"pushed_at":"2024-10-29T12:47:20.000Z","size":131,"stargazers_count":31,"open_issues_count":1,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-20T23:42:02.547Z","etag":null,"topics":["aps","graph","information-cascades","information-diffusion","popularity-prediction","twitter","weibo"],"latest_commit_sha":null,"homepage":"https://www.xoveexu.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Xovee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-03T03:04:15.000Z","updated_at":"2025-03-14T09:17:36.000Z","dependencies_parsed_at":"2024-11-05T13:21:18.562Z","dependency_job_id":null,"html_url":"https://github.com/Xovee/casflow","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xovee%2Fcasflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xovee%2Fcasflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xovee%2Fcasflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Xovee%2Fcasflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Xovee","download_url":"https://codeload.github.com/Xovee/casflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305255,"owners_count":20917194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aps","graph","information-cascades","information-diffusion","popularity-prediction","twitter","weibo"],"created_at":"2024-11-05T13:10:09.568Z","updated_at":"2025-04-05T07:30:53.421Z","avatar_url":"https://github.com/Xovee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CasFlow\n\n![](https://img.shields.io/badge/TKDE-2021-blue)\n![](https://img.shields.io/badge/python-3.9.7-green)\n![](https://img.shields.io/badge/tensorflow-2.9.1-green)\n![](https://img.shields.io/badge/cudatoolkit-11.2.2-green)\n![](https://img.shields.io/badge/cudnn-8.1.0-green)\n \nThis repo provides a reference implementation of **CasFlow** as described in the paper:\n\u003e [CasFlow: Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction](https://doi.org/10.1109/TKDE.2021.3126475)  \n\u003e [Xovee Xu](https://www.xoveexu.com), [Fan Zhou](https://dblp.org/pid/63/3122-2.html), [Kunpeng Zhang](http://www.terpconnect.umd.edu/~kpzhang/), [Siyuan Liu](https://scholar.google.com/citations?user=Uhvt7OIAAAAJ\u0026hl=en), and [Goce Trajcevski](https://dblp.org/pid/66/974.html)  \n\u003e IEEE Transactions on Knowledge and Data Engineering (TKDE), 2021\n\n## Basic Usage\n\n### Requirements\n\nThe 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](https://www.anaconda.com/):\n\n```shell\n# create virtual environment\nconda create --name casflow python=3.9 \n\n# activate environment\nconda activate casflow\n\n# install tensorflow and other requirements\nconda install -c conda-forge cudatoolkit=11.2 cudnn=8.1.0\npip install -r requirements.txt\n```\n\nA note from 2024: fu*k tensorflow\n\n\u003cdetails\u003e\n \u003csummary\u003eIf you fail to initialize the GPU\u003c/summary\u003e\n\n 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:\n\n ```shell\n unset CUDA_HOME\n unset LD_LIBRARY_PATH\n\n export PATH=$CONDA_PREFIX/lib:$PATH\n export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH\n ```\n\n Then you can try using the GPU:\n ```python\n import tensorflow as tf\n print(tf.config.list_physical_devices('GPU'))\n ```\n \n\u003c/details\u003e\n\n### Run the code\n```shell\ncd ./casflow\n\n# generate information cascades\npython gene_cas.py --input=./dataset/sample/\n\n# generate cascade graph and global graph embeddings \npython gene_emb.py --input=./dataset/sample/\n\n# run CasFlow model\npython casflow.py --input=./dataset/sample/\n```\nMore running options are described in the codes, e.g., \n\n- Using the Weibo dataset: `--input=./dataset/weibo/`\n- Change observation time: `--observation_time=3600`\n\n## Datasets\n\nSee some sample cascades in `./dataset/sample/`.\n\nDatasets download link: [Google Drive](https://drive.google.com/file/d/1o4KAZs19fl4Qa5LUtdnmNy57gHa15AF-/view?usp=sharing) or [Baidu Drive (password: `1msd`)](https://pan.baidu.com/s/1tWcEefxoRHj002F0s9BCTQ).\n\nThe datasets we used in the paper are come from:\n\n- [Twitter](http://carl.cs.indiana.edu/data/#virality2013) (Weng *et al.*, [Virality Prediction and Community Structure in Social Network](https://www.nature.com/articles/srep02522), Scientific Report, 2013).\n- [Weibo](https://github.com/CaoQi92/DeepHawkes) (Cao *et al.*, [DeepHawkes: Bridging the Gap between \nPrediction and Understanding of Information Cascades](https://dl.acm.org/doi/10.1145/3132847.3132973), CIKM, 2017). You can also download Weibo dataset [here](https://drive.google.com/file/d/1fgkLeFRYQDQOKPujsmn61sGbJt6PaERF/view?usp=sharing) in Google Drive.  \n- [APS](https://journals.aps.org/datasets) (Released by *American Physical Society*, obtained at Jan 17, 2019).  \n\n## Cite\n\nIf you find **CasFlow** useful for your research, please consider citing us 😘:\n\n    @article{xu2021casflow,  \n      author = {Xovee Xu and Fan Zhou and Kunpeng Zhang and Siyuan Liu and Goce Trajcevski},  \n      title = {Cas{F}low: Exploring Hierarchical Structures and Propagation Uncertainty for Cascade Prediction},\n      journal = {IEEE Transactions on Knowledge and Data Engineering (TKDE)},\n      year = {2021}, \n      volume = {35}, \n      number = {4}, \n      pages={3484-3499}, \n      doi = {10.1109/TKDE.2021.3126475}, \n    }\n\n    \nThis paper is an extension of [VaCas](https://doi.org/10.1109/INFOCOM41043.2020.9155349):\n\n    @inproceedings{zhou2020variational,\n      author = {Fan Zhou and Xovee Xu and Kunpeng Zhang and Goce Trajcevski and Ting Zhong},\n      title = {Variational Information Diffusion for Probabilistic Cascades Prediction}, \n      booktitle = {IEEE International Conference on Computer Communications (INFOCOM)},\n      year = {2020},\n      pages = {1618--1627},\n      doi = {10.1109/INFOCOM41043.2020.9155359},\n    }\n    \n\nWe also have a [survey paper](https://dl.acm.org/doi/10.1145/3433000) you might be interested:\n\n\n    @article{zhou2021survey,\n      author = {Fan Zhou and Xovee Xu and Goce Trajcevski and Kunpeng Zhang}, \n      title = {A Survey of Information Cascade Analysis: Models, Predictions, and Recent Advances}, \n      journal = {ACM Computing Surveys}, \n      volume = {54},\n      number = {2},\n      year = {2021},\n      articleno = {27},\n      numpages = {36},\n      doi = {10.1145/3433000},\n    }\n\n## Contact\n\nFor any questions please open an issue or drop an email to: `xovee at live.com`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxovee%2Fcasflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxovee%2Fcasflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxovee%2Fcasflow/lists"}