项目作者: calvin-zcx

项目描述 :
Neural Dynamics on Complex Networks
高级语言: Python
项目地址: git://github.com/calvin-zcx/ndcn.git
创建时间: 2019-04-29T22:30:37Z
项目社区:https://github.com/calvin-zcx/ndcn

开源协议:

下载


Neural Dynamics on Complex Networks

Please refer to our paper:

Zang, Chengxi, and Fei Wang. “Neural dynamics on complex networks.” In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 892-902. 2020.

  1. @inproceedings{zang2020neural,
  2. title={Neural dynamics on complex networks},
  3. author={Zang, Chengxi and Wang, Fei},
  4. booktitle={Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery \& Data Mining},
  5. pages={892--902},
  6. year={2020}
  7. }

Install libs:

  1. conda create --name ndcn
  2. conda activate ndcn
  3. conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
  4. conda install networkx
  5. conda install matplotlib
  6. conda install scipy
  7. conda install scikit-learn
  8. conda install pandas
  9. Besides, we adapted torchdiffeq in https://github.com/rtqichen/torchdiffeq into a local package due the change of its oringinal codes

Learning continous-time or regularly-sampled graph dynamics

NDCN for mutualistic interation dynamics

Python files: mutualistic_dynamics.py

  1. python mutualistic_dynamics.py --T 5 --network grid --dump --sampled_time irregular --baseline ndcn --viz --gpu -1 --weight_decay 1e-2

—network * for underlining graph with choices=[‘grid’, ‘random’, ‘power_law’, ‘small_world’, ‘community’]

—sampled_time
for irregularlly-sampled graph dynamics or regularly sampled ones with choices=[‘irregular’, ‘equal’]

—baseline ** chooses any model from choices=[‘ndcn’, ‘no_embed’, ‘no_control’, ‘no_graph’, ‘lstm_gnn’, ‘rnn_gnn’, ‘gru_gnn’]

Please refer to the code for the detailed parameter choices

Similar commands for heat-diffusion dynamics or gene regulatory dynamics

Python files: heat_dynamics.py and gene_dynamics.py

  1. python heat_dynamics.py --T 5 --network grid --dump --sampled_time irregular --baseline ndcn --viz --gpu -1 --weight_decay 1e-3
  2. python gene_dynamics.py --T 5 --network grid --dump --sampled_time irregular --baseline ndcn --viz --gpu -1 --weight_decay 1e-4

Refer to Animations in gif folder

Heat Diffusion on a Grid Graph, Ground Truth

Heat Diffusion Ground True

Heat Diffusion on a Grid Graph Learned by our NDCN model

Heat Diffusion NDCN

3 dynamics (gene, heat, mutualistic dynamics) on 5 graphs (grid’, ‘random’, ‘power_law’, ‘small_world’, ‘community’ graphs) are shown in gif folder,
or
download our ppt https://drive.google.com/file/d/1KBl-6Oh7BRxcQNQrPeHuKPPI6lndDa5Y and show in full screen to check our compiled animations.

Semisupervised learning on graphs by our continuous-time GNN model:

—iter 100 experiments:

  1. python dgnn.py --dataset cora --model differential_gcn --iter 100 --dropout 0 --hidden 256 --T 1.2 --time_tick 16 --epochs 100 --dump --weight_decay 0.024 --no_control --method dopri5 --alpha 0

a showcased results by my laptop for —iter 5 experiments:

  1. Total time: 772.3850s;
  2. results: 83.180% (mean) +/- 0.756% (std), 83.000% (median);
  3. Min_Acc: 82.600%, Max_Acc: 84.500%
  4. {'no_cuda': False, 'fastmode': False, 'seed': -1, 'epochs': 100, 'rtol': 0.1, 'atol': 0.1, 'lr': 0.01, 'weight_decay': 0.024, 'nHiddenLayers': 0, 'hidden': 256, 'dropout': 0.0, 'dataset': 'cora', 'model': 'differential_gcn', 'iter': 5, 'dump': True, 'delta': 1.0, 'sms': False, 'normalize': False, 'Euler': False, 'T': 1.2, 'time_tick': 16, 'no_control': True, 'method': 'dopri5', 'alpha': 0.0, 'cuda': False}