Skip to main content

A differentiable physics engine written in JAX.

Project description

BRAX

Brax is a fast and fully differentiable physics engine used for research and development of robotics, human perception, materials science, reinforcement learning, and other simulation-heavy applications.

Brax is written in JAX and is designed for use on acceleration hardware. It is both efficient for single-device simulation, and scalable to massively parallel simulation on multiple devices, without the need for pesky datacenters.

Brax simulates environments at millions of physics steps per second on TPU, and includes a suite of learning algorithms that train agents in seconds to minutes:

One API, Three Pipelines

Brax offers three distinct physics pipelines that are easy to swap:

These pipelines share the same API and can run side-by-side within the same simulation. This makes Brax well suited for experiments in transfer learning and closing the gap between simulation and the real world.

Quickstart: Colab in the Cloud

Explore Brax easily and quickly through a series of colab notebooks:

  • Brax Basics introduces the Brax API, and shows how to simulate basic physics primitives.
  • Brax Training introduces the Brax v2 API, and shows how to train a policy with the generalized backend.

Using Brax Locally

To install Brax from pypi, install it with:

python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install brax

You may also install from Conda or Mamba:

conda install -c conda-forge brax  # s/conda/mamba for mamba

Alternatively, to install Brax from source, clone this repo, cd to it, and then:

python3 -m venv env
source env/bin/activate
pip install --upgrade pip
pip install -e .

To train a model:

learn

Training on NVidia GPU is supported, but you must first install CUDA, CuDNN, and JAX with GPU support.

Learn More

For a deep dive into Brax's design and performance characteristics, please see our paper, Brax -- A Differentiable Physics Engine for Large Scale Rigid Body Simulation , which appeared in the Datasets and Benchmarks Track at NeurIPS 2021.

Citing Brax

If you would like to reference Brax in a publication, please use:

@software{brax2021github,
  author = {C. Daniel Freeman and Erik Frey and Anton Raichuk and Sertan Girgin and Igor Mordatch and Olivier Bachem},
  title = {Brax - A Differentiable Physics Engine for Large Scale Rigid Body Simulation},
  url = {http://github.com/google/brax},
  version = {0.9.0},
  year = {2021},
}

Acknowledgements

Brax has come a long way since its original publication. We offer gratitude and effusive praise to the following people:

  • Manu Orsini and Nikola Momchev who provided a major refactor of Brax's training algorithms to make them more accessible and reusable.
  • Erwin Coumans who has graciously offered advice and mentorship, and many useful references from Tiny Differentiable Simulator.
  • Baruch Tabanpour, a colleague who helped launch brax v2 and overhauled the contact library.
  • Shixiang Shane Gu and Hiroki Furuta, who contributed BIG-Gym and Braxlines, and a scene composer to Brax.
  • Our awesome open source collaborators and contributors. Thank you!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brax-0.9.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

brax-0.9.0-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

File details

Details for the file brax-0.9.0.tar.gz.

File metadata

  • Download URL: brax-0.9.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for brax-0.9.0.tar.gz
Algorithm Hash digest
SHA256 bf25527d12b42f036d25ebe6e881045e512179bd92385ede839918d130cca70e
MD5 3510890c137756780eb3b1b114b97299
BLAKE2b-256 4d4ff57a5d24fb91e4fec4b363747580e4cd5c9063f4b3476a524f1488ee2e54

See more details on using hashes here.

Provenance

File details

Details for the file brax-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: brax-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for brax-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4ac2662f693ddc9a589a94fe3adc27b5060b8d3fc0badef3daf726d78f6656ff
MD5 57d22698a506f61cb708d9b077a4a71c
BLAKE2b-256 42b988db927d2c13102afdfa68949f7a396113650a2ec5933ccf640c785d7b1c

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page