Giter VIP home page Giter VIP logo

aidd's Introduction

AIDD

This repository will contain the official PyTorch implementation of:

Automated Discovery of Interactions and Dynamics for Large Networked Dynamical Systems

Yan Zhang1, Yu Guo2,3, Zhang Zhang1, Mengyuan Chen1, Shuo Wang1, and Jiang Zhang1,*

1Beijing Normal University, Beijing, China

2State Key Laboratory for Novel Software Technology at Nanjing University, Nanjing, China

3Software Institute, Nanjing University, Nanjing, China

*[email protected]

https://arxiv.org/abs/2101.00179

ABSTRACT

Understanding the mechanisms of complex systems is very important. According to specific dynamic rules, a networked dynamical system, understanding a system as a group of nodes interacting on a given network, is a powerful tool for modelling complex systems. However, finding such models according to time series of behaviours is difficult. Conventional methods can work well only on small networks and for some types of dynamics. This paper proposes a unified framework for an automated interaction network and dynamics discovery (AIDD) on various network structures and dynamics, based on a stochastic gradient descent algorithm. The experiments show that AIDD can be applied to large systems with thousands of nodes and is robust against noise and missing information. We further propose a new method to test data-driven models based on control experiments. The results show that AIDD is able to learn the real network dynamics correctly.

Requirements

  • python 3.7.7
  • pytorch 1.5.0
  • networkx 2.4
  • netrd 0.2.2
  • numpy 1.18.1
  • scipy 1.4.1

Directory description

AIDD

We put the single step prediction training algorithm of AIDD in this folder.

The framework consists of two parts: a network generator and a dynamics learner. The input of the model is the state information of all nodes at time t, and the output of the model is the predicted state information of all nodes at time t +1. The inferred adjacency matrix \hat{A} can also be retrieved from the network generator.

Data Generation

The files whose name starts with "generate" are files that generate data.For example, if you want to generate data of spring,you can run the file generate_spring.py

python generate_spring.py
or
nohup python -u generate_spring.py > generate_spring.txt 2>&1 & #Save the output file to a text file

Run Experiment

The files whose name starts with "train" are files that train. For example, if you want to run the experiment of spring, you can run the file train_spring.py

python train_spring.py
or
nohup python -u train_spring.py > train_spring.txt 2>&1 & #Save the output file to a text file

Test Model Performance

The files whose name starts with "test" are files that test. For example, if you want to test the model of spring, you can run the file test_spring.py

python test_spring.py
or
nohup python -u test_spring.py > test_spring.txt 2>&1 & #Save the output file to a text file

AIDD_Multi_step_prediction

We put the multi-step prediction training algorithm of AIDD in this folder.

In continuous dynamics prediction tasks, to obtain a high prediction accuracy, multi-step prediction training is needed. That is, input the current state at time t, to predict the states at time t +1; t+2;...; t +T.

Data Generation

you can run the file generate_spring.py

python generate_spring.py
or
nohup python -u generate_spring.py > generate_spring.txt 2>&1 & #Save the output file to a text file

Run Experiment

you can run the file train_spring_mutistep.py

python train_spring_multistep.py
or
nohup python -u train_spring_multistep.py > train_spring_multistep.txt 2>&1 & #Save the output file to a text file

Test Model Performance

you can run the file test_spring_multistep.py

python test_spring_multistep.py
or
nohup python -u test_spring_multistep.py > test_spring_multistep.txt 2>&1 & #Save the output file to a text file

Controller_Optimization

We design control experiments to test a learned model. The control experiment can be separated into two phases. In the first stage, we find the optimized controller’s parameters on the learned network dynamics to achieve the designed objective. In the second stage, we do the same optimization but directly on the ground truth model. After that, we compare the results on controls.

Before you run the controller experiment , you must run the single step prediction training algorithm of AIDD to get the learned model. And you should put the learned model into the "model" directory under the current folder, put the corresponding data into the "data" directory under the current folder.

For convenience, we put our trained model and data in the corresponding folder, you can use it directly.

Optimized controller's parameters on the learned model

For example, if you want to control the model of spring, you can run the file control_spring_ourmodel_ournet.py

python control_spring_ourmodel_ournet.py

Do the same optimization on the ground truth model

For example, if you want to control the model of spring, you can run the file control_spring_controlmodel_realdyn.py

python control_spring_controlmodel_realdyn.py

Optimized controller's parameters on the real dynamics system

For example, if you want to control the model of spring, you can run the file control_spring_realdyn_realnet.py

python control_spring_realdyn_realnet.py

Network Completetion

The basic idea of the network completion algorithm is to set the initial states of the unobserved nodes as a set of new learnable parameters. Therefore, we can use the similar method with AIDD to learn the missing partial network and the initial states of the unobserved nodes. The parameters of dynamics learner can be also fine tuned.

Data Generation

The files whose name starts with "generate" are files that generate data.For example, if you want to generate data of voter, you can run the file generate_voter.py

python generate_voter.py
or
nohup python -u generate_voter.py > generate_voter.txt 2>&1 & #Save the output file to a text file

Run Experiment

The files whose name starts with "train" are files that train. For example, if you want to run the experiment of voter, you can run the file train_voter_completetion.py

python train_voter_completetion.py
or
nohup python -u train_voter_completetion.py > train_voter_completetion.txt 2>&1 & #Save the output file to a text file

Cite

If you use this code in your own work, please cite our paper

@article{zhang2021automated,
  title={Automated Discovery of Interactions and Dynamics for Large Networked Dynamical Systems},
  author={Zhang, Yan and Guo, Yu and Zhang, Zhang and Chen, Mengyuan and Wang, Shuo and Zhang, Jiang},
  journal={arXiv preprint arXiv:2101.00179},
  year={2021}
}

aidd's People

Contributors

kby24 avatar bing170215 avatar

Stargazers

 avatar Zhenwei Dong avatar  avatar  avatar  avatar  avatar Bing Yuan avatar TzuRen avatar Xiao Ding avatar  avatar 3riccc avatar  avatar  avatar Gerrit avatar

Watchers

James Cloos avatar  avatar

aidd's Issues

Gumbel Softmax Hard Version

Hi. I see why there are two verisons of Gumbel softmax in the codes. However, only soft version has been interpreted in the paper. Is there any theoretical basis for the hard version? Or it is only a heuristic trial .Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.