* Add hgat example * Add experiment * Clean code * clear the code * Add index in README * Add index in README * Add index in README * Add index in README * Add index in README * Add index in README * Change the code title and folder name * Ready to merge * Prepare for rebase and change message passing function * use git ignore to handle empty file * change file permission to resolve empty file * Change permission * change file mode * Finish Coding * working code cpu * pyg compare * Accelerate with batching * FastMode Enabled * update readme * Update README.md * refractor code * add graphsim code * modified code * few fix * Modified graphsim * Simple Model Added * Clean up code * Refractor the code for Merge * Bugfix enable gradient when train * update readme and format Co-authored-by: Chen <chesirui@3c22fbe5458c.ant.amazon.com> Co-authored-by: Tianjun Xiao <xiaotj1990327@gmail.com> Co-authored-by: Ubuntu <ubuntu@ip-172-31-4-63.ap-northeast-1.compute.internal> Co-authored-by: Ubuntu <ubuntu@ip-172-31-45-47.ap-northeast-1.compute.internal>
GraphParticleSim
DGL Implementation of Interaction-Network paper.
This DGL example implements the GNN model proposed in the paper Interaction Network.
GraphParticleSim implementor
This example was implemented by Ericcsr during his Internship work at the AWS Shanghai AI Lab.
The graph dataset used in this example
This Example uses Datasets Generate By Physics N-Body Simulator adapted from This Repo
n_body: - n Particles/Nodes - Complete Bidirectional Graph - 10 trajectories should be generated - 1000 steps of simulation per trajectory
Dependency
- ffmpeg 4.3.8
- opencv-python 4.2.0
How to run example files
In the graphsim folder, run
Please first run n_body_sim.py to generate some data
Using Ground Truth Velocity From Simulator Directly.
python n_body_sim.py
Generate Longer trajectory or more trajectories.
python n_body_sim.py --num_traj <num_traj> --steps <num_steps>
Please use train.py
python train.py --number_workers 15
Training with GPU
python train.py --gpu 0 --number_workers 15
Training with visualization: for valid visualization, it might take full 40000 epoch of training
python train.py --gpu 0 --number_workers 15 --visualize
One Step Loss Performance, Loss of test data after 40000 training epochs.
| Models/Dataset | 6 Body |
|---|---|
| Interaction Network in DGL | 80(10) |
| Interaction Network in Tensorflow | 60 |
Notice that The datasets are generated directly from simulator to prevent using Tensorflow to handle the original dataset. The training is very unstable, the even if the minimum loss is achieved from time to time, there are chances that loss will suddenly increase,in both auther's model and our model. Since the original model hasn't been released, the implementation of this model refers to Tensorflow version implemented in: https://github.com/jsikyoon/Interaction-networks_tensorflow which had consulted the first author for some implementation details.