Skip to main content
BRAX

WARNING Only brax/training is actively being maintained as of 0.13.0. Instead of brax/envs, users should use MuJoCo Playground, all of which train well with brax/training. If you want to use Brax for physics simulation, please use MJX available at github.com/google-deepmind/mujoco (pip install mujoco_mjx) or MuJoCo Warp rather than Brax as a wrapper to MuJoCo physics simulation. We may repurpose brax purely as an RL library in the future.

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, Four Pipelines

Brax offers four 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 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 MuJoCo XLA - MJX demonstrates training in Brax using the MJX physics simulator.
  • Brax Training with PyTorch on GPU demonstrates how Brax can be used in other ML frameworks for fast training, in this case PyTorch.

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.14.2},
  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!

Release files for brax 0.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for brax 0.14.2
File Size Uploaded
brax-0.14.2.tar.gz 211.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for brax 0.14.2
File Interpreter ABI Platform
brax-0.14.2-py3-none-any.whl Python 3 none any Details

Total release size: 568.4 kB

Release files / brax-0.14.2.tar.gz

Download URL brax-0.14.2.tar.gz
Size 211.6 kB
Tags Source
SHA-256 checksum
How to use checksums
fd5240fb30ea0d7b0a9da162eb4a460c3ad415c049453936118e2e05089222c2
BLAKE2b-256 checksum
How to use checksums
0f64c9edc16f856641a4ae5e21372cb5c56344971f5665f0b2dfbd2dbc8e0dfc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / brax-0.14.2-py3-none-any.whl

Download URL brax-0.14.2-py3-none-any.whl
Size 356.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d33b7b222ba5d85fd0fc4d4c59aa46feb978684107ad3f79de6bfef97ab06693
BLAKE2b-256 checksum
How to use checksums
2c34c12809ec36063ffab41880b37f2305f8d502345dbf6b5a6471133231c687
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.14.2 This release

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.5

2 release files

0.12.4

2 release files

0.12.3

2 release files

0.12.2

1 release file

0.12.1

2 release files

0.10.4

2 release files

0.10.3

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.16

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page