GithubHelp home page GithubHelp logo

graph-nn-physics's Introduction

Differentiable physics simulation with graph neural networks

This is an implementation of Learning to Simulate Complex Physics with Graph Networks, written in PyTorch.

Currently, basic 2D simulation works fairly well. I haven't had the time to train the model for more than 400k epochs, so the current results are not as polished as they would be when the network is trained to 20M epochs. Here's a few examples of the network's predictions after being given an initial position and five previous velocities:

water-0 water-1 water-2

As you can see, by this point the network has not fully learned to respect boundaries, and for some reason particles that are far away from others fly off in weird directions (it may be due to the network getting little experience with particles that have no edges connected to them). However, it has the right idea and most of the simulations look plausible.

I anticipate that the network will likely work with 3D datasets without any modification, but training such a network requires more VRAM than a tesla v100 or RTX 3090, the GPUs I have access to, have. I do have plans to train this on a TPU at some point. I will release more GIFs once I have the time to train a 10M epoch network on more than just the 2d water dataset (I haven't set up the particle embeddings yet).

Get started by running python -m graph_nn_physics -h to train, and python -m visualize.{ learned | edges | dataset } for various visualizations of the dataset and inferred data.

graph-nn-physics's People

Contributors

kmani314 avatar

Stargazers

Nuh Muhammed Pişkin avatar Chenghan Sun avatar Xin Lei avatar

Watchers

James Cloos avatar  avatar

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.