Skip to main content

A differentiable physics engine written in JAX.

Project description

BRAX

Brax is a differentiable physics engine that simulates environments made up of rigid bodies, joints, and actuators. 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.

Some policies trained via Brax. Brax simulates these environments at millions of physics steps per second on TPU.

Brax also includes a suite of learning algorithms that train agents in seconds to minutes:

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 Environments shows how to operate and visualize Brax environments. It also demonstrates converting Brax environments to Gym environments, and how to use Brax via other ML frameworks such as PyTorch.
  • Brax Training with TPU introduces Brax's training algorithms, and lets you train your own policies directly within the colab. It also demonstrates loading and saving policies.
  • Brax Training with PyTorch on GPU demonstrates how Brax can be used in other ML frameworks for fast training, in this case PyTorch.
  • Brax Multi-Agent measures Brax's performance on multi-agent simulation, with many bodies in the environment at once.

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

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 , to appear 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.0.11},
  year = {2021},
}

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.0.11.tar.gz (116.2 kB view details)

Uploaded Source

Built Distribution

brax-0.0.11-py3-none-any.whl (186.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: brax-0.0.11.tar.gz
  • Upload date:
  • Size: 116.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for brax-0.0.11.tar.gz
Algorithm Hash digest
SHA256 c69e059e42c3d0c7f9b0880d552ee993a5e66ec34b7ba1b52ae0163d2e5404e6
MD5 3ad9bf5c3af8f633787acd1c4702aced
BLAKE2b-256 65ccb8669de3fb682a0159063f183f7581d4e9a6aea383e27757bc5d5ef9d58b

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: brax-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 186.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for brax-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 fe10d16083ee591149d2166eb4d0eead960b7fa3148260b33aabaaaa870ddb04
MD5 5f55588924ba349185fc5d3389e05fa0
BLAKE2b-256 03981827fca82a007e8cc50f78e868675e158654ae36f7b00edf38a7da43a190

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