Skip to content

haeriamin/Subspace-Graph-Physics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Subspace Graph Physics:
Real-Time Rigid Body-Driven Granular Flow Simulation

This is a computationally efficient version of "Learning To Simulate" developed by DeepMind and Stanford researchers, for real-time 3D physics simulations (e.g. for granular flows and their interactions with rigid bodies).

drawing

Highlights

  • We train the graph network (GN) model in subspace by performing Principal Component Analysis (PCA).

  • PCA enables GN to be trained using a single desktop GPU with moderate VRAM for large 3D configurations.

  • The training datasets can be generated by our efficient and accurate Material Point Method (MPM).

  • The rollout runtime is under 1 sec/sec, and the training runtime is 60 global-step/sec (on NVIDIA RTX 3080).

  • The particle positions and velocities, and rigid body interaction forces are compared above.

Install and Run Demo

  • Install

  • Train

    python -m learning_to_simulate.train --mode=train --eval_split=train --batch_size=2 --data_path=./learning_to_simulate/datasets/Excavation_PCA --model_path=./learning_to_simulate/models/Excavation_PCA
  • Test

    python -m learning_to_simulate.train --mode=eval_rollout --eval_split=test --data_path=./learning_to_simulate/datasets/Excavation_PCA --model_path=./learning_to_simulate/models/Excavation_PCA --output_path=./learning_to_simulate/rollouts/Excavation_PCA
  • Visualize

    • 2D plot

      python -m learning_to_simulate.render_rollout_2d_force --plane=xy --data_path=./learning_to_simulate/datasets/Excavation_PCA --rollout_path=./learning_to_simulate/rollouts/Excavation_PCA/rollout_test_0.pkl
    • 3D plot

      python -m learning_to_simulate.render_rollout_3d --fullspace=True --data_path=./learning_to_simulate/datasets/Excavation_PCA --rollout_path=./learning_to_simulate/rollouts/Excavation_PCA/rollout_test_0.pkl

Bibtex

Please cite our papers [1, 2] if you use this code for your research:

@misc{haeri2021subspace,
    title={Subspace Graph Physics: Real-Time Rigid Body-Driven Granular Flow Simulation}, 
    author={Amin Haeri and Krzysztof Skonieczny},
    year={2021},
    eprint={2111.10206},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

and/or

@INPROCEEDINGS{9438132,
    author={Haeri, A. and Skonieczny, K.},
    booktitle={2021 IEEE Aerospace Conference (50100)},
    title={Accurate and Real-time Simulation of Rover Wheel Traction},
    year={2021},
    volume={},
    number={},
    pages={1-9},
    doi={10.1109/AERO50100.2021.9438132}
}