Git Product home page Git Product logo

diff_sim_grads's Introduction


Differentiable Physics Simulations with Contacts: Do They Have Correct Gradients w.r.t. Position, Velocity and Control?

Yaofeng Desmond Zhong, Jiequn Han, Georgia Olympia Brikis | 2022

Conference Paper

This repository contains scripts to reproduce results in our paper.

Reproducibility

All experiments do not require GPUs.

To install all dependencies:

pip install -r requirements.txt
# or to install the exact versions of packages as done in this work. 
pip install -r requirements_freeze.txt

Please check out the README files in the task folders for how to reproduce the results shown in the paper.

Overview

In this work, we compare the gradients calculated by different differentiable contact models as shown in the following table.

Differentiable contact models Implementations
Linear complementarity problems (LCPs) NimblePhysics
Convex optimization DiffCoSim
Compliant models Warp and Brax
Position-based dynamics (PBD) Warp and Brax
Direct Velocity Impulse DiffTaichi

We apply these implementations to three tasks.

Task 1. Gradients with a Simple Collision Task 2. Optimize the Initial Velocity of a Bouncing Ball to Hit a Target Task 3. Learning Optimal Control with a Two-ball Collision
drawing drawing drawing

Our results show that gradients calculated by different implementation do not agree. Some implementations fail to achieve the optimization tasks. Please check out our paper for more details.

Task 3 Results

In this tasks, we are able to derive the analytical gradients and the analytical optimal control. Here we plot the analytical optimal loss along with the learning curves as well as the analytical optimal control and learned optimal controls. We observe that some differentiable simulators learn zero control sequences and fail to achieve the optimization task.

drawing

Citation

If you find this work helpful, please consider citing our paper using the following Bibtex.

@article{zhong2022differentiable,
  title={Differentiable Physics Simulations with Contacts: Do They Have Correct Gradients w.r.t. Position, Velocity and Control?},
  author={Zhong, Yaofeng Desmond and Han, Jiequn and Brikis, Georgia Olympia},
  journal={arXiv preprint arXiv:2207.05060},
  year={2022}
}

diff_sim_grads's People

Contributors

desmondzhong 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.