Skip to main content
Files added late

3 files were added to this release more than 14 days after its initial publication. Inspect the release files before installing.

GitHub license CircleCI

PHYRE is a benchmark for physical reasoning.

It provides a set of physics puzzles in a simulated 2D world. Each puzzle has a goal state (e.g., make the green ball touch the blue wall) and an initial state in which the goal is not satisfied (see the figure below). A puzzle can be solved by placing one or more new bodies in the environment such that when the physical simulation is run the goal is satisfied. An agent playing this game must solve previously unseen puzzles in as few attempts as possible.

phyre

How to use the PHYRE

Phyre framework could be used for several tasks related to physical reasoning.

  • As a benchmark: Phyre allows to evaluate different reasoning agents on a predefined set of tasks and complexity tiers. You can explore the tasks and try to solve them using the demo.
  • As a task building platform: Phyre contains a framework to create new levels with goals and objects from a way richer set that one used in the standard tiers. This could be used to study specific types of generalization for reasoning agents, performance or forward modelling, or something else, e.g., enable reasoning about physics in natural language. See this doc for details.
  • As an interface to a fast physical engine: Phyre uses Box2d engine under the hood. In the benchmark we hide all details of the simulation. See this doc for details on low level interface.

Getting started

Installation

The simplest way to install PHYRE is via pip. As PHYRE requires Python version 3.6, we recommend installing PHYRE inside a virtual environment, e.g. using Conda.

We provide PHYRE as a pip package for both Linux and Mac OS.

conda create -n phyre python=3.6 && conda activate phyre
pip install phyre

To check that the installation was successful, run python -m phyre.server and open http://localhost:30303. That should start a local demo server.

For instructions on building PHYRE from source and installing in a Docker container, see INSTALLATION.

Notebooks

We provide jupyter notebooks that show how to use PHYRE API (open in Colab) to run simulations and evaluate a random agent and how to use simulation cache (open in Colab) to train agents faster.

Training an agent

We provide a set of baseline agents that are described in the paper. In order to run them, you need to install additional python dependencies with pip install -r requirements.agents.txt.

All the agents are located in agents/ folder. The entry point is train.py that will train an agent on specified eval setup with a specified fold. E.g., the following command will train a memoization agent:

python agents/train.py \
    --output-dir=results/ball_cross_template/0 \
    --eval-setup-name=ball_cross_template \
    --fold-id=0 \
    --mem-rerank-size 100 \
    --agent-type=memoize

File run_experiment.py contains groups of experiments, e.g, sweeping over number of update for DQN-O or training agents on all seeds and eval setups. And train_all_baseline.sh starts experiments to train all baseline algorithms in the paper.

License

PHYRE is released under the Apache license. See LICENSE for additional details.

Citation

If you use PHYRE in your experiments, please cite it:

@article{bakhtin2019phyre,
    title={PHYRE: A New Benchmark for Physical Reasoning},
    author={Anton Bakhtin and Laurens van der Maaten and Justin Johnson and Laura Gustafson and Ross Girshick},
    year={2019},
    journal={arXiv:1908.05656}
}

Related projects

Virtual Tools is a similar project aiming to research the structure necessary to capture human-like reasoning in these sorts of physics puzzles.

ESPRIT is a framework based on PHYRE that connects physical reasoning and natural language explanations.

Metadata

Release files for phyre 0.2.2

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

Files added late

3 files were uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release files before installing.

Built distributions (wheels)

Table of built distributions (wheels) for phyre 0.2.2
File
phyre-0.2.2-cp39-none-manylinux1_x86_64.whl CPython 3.9 none Linux glibc 2.5+ x86-64 Details
phyre-0.2.2-cp38-none-manylinux1_x86_64.whl CPython 3.8 none Linux glibc 2.5+ x86-64 Details
phyre-0.2.2-cp37-none-manylinux1_x86_64.whl CPython 3.7 none Linux glibc 2.5+ x86-64 Details
phyre-0.2.2-cp36-none-manylinux1_x86_64.whl CPython 3.6 none Linux glibc 2.5+ x86-64 Details
phyre-0.2.2-cp36-none-macosx_10_15_x86_64.whl CPython 3.6 none macOS 10.15+ x86-64 Details

Total release size: 79.2 MB

Release files / phyre-0.2.2-cp39-none-manylinux1_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL phyre-0.2.2-cp39-none-manylinux1_x86_64.whl
Size 15.8 MB
Tags CPython 3.9 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
cf865c34aa8252e4d9445ab6440439651c308fe12999217c5e16f048198dd56f
BLAKE2b-256 checksum
How to use checksums
3f63132de8a84bd033ac863f8faf27cf5cede4e47b5f76cbc766bffa51e55ee0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.11

Release files / phyre-0.2.2-cp38-none-manylinux1_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL phyre-0.2.2-cp38-none-manylinux1_x86_64.whl
Size 15.8 MB
Tags CPython 3.8 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
9b7eccef5d807b97ca428f2ebac3b7949f2fcddc2f002dba15f6f340e08ea747
BLAKE2b-256 checksum
How to use checksums
8367f878f0e9293db59e3a7daeea995a5dbba5fea88d2e8596677eeffdc167b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.11

Release files / phyre-0.2.2-cp37-none-manylinux1_x86_64.whl

File added late

This file was uploaded more than 14 days after the first file in this release.

While project maintainers occasionally add legitimate files to an existing release, late additions can also indicate a security compromise.

We recommend inspecting the release file before installing.

Download URL phyre-0.2.2-cp37-none-manylinux1_x86_64.whl
Size 15.8 MB
Tags CPython 3.7 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
6c4abb55db29e11b5ee6d62cba3c5043a192c8a279998781e8a12bb443e71be6
BLAKE2b-256 checksum
How to use checksums
77b7a8f0e676dd89bf3a1d5ca1bd7d3bf99985e109c7f4a47bd34f8bb6fdd54c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.7.11

Release files / phyre-0.2.2-cp36-none-manylinux1_x86_64.whl

Download URL phyre-0.2.2-cp36-none-manylinux1_x86_64.whl
Size 15.8 MB
Tags CPython 3.6 Linux glibc 2.5+ x86-64
SHA-256 checksum
How to use checksums
afd9596a77cf5aaf91f5bb1f4c7a00be0d3c5f2e50d2d3b4bb4031cc90d6638d
BLAKE2b-256 checksum
How to use checksums
76ebb5770342caff8ca1a549684e1b0153072de37731c9e5a3a19985baa8dc6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

Release files / phyre-0.2.2-cp36-none-macosx_10_15_x86_64.whl

Download URL phyre-0.2.2-cp36-none-macosx_10_15_x86_64.whl
Size 15.8 MB
Tags CPython 3.6 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
405ebe93e2791364307c9e06ab32e13bf9748743eae6d0aab082de5ae9408947
BLAKE2b-256 checksum
How to use checksums
b8cd26c27e9fa519646b66a21d5f9377fac0528b1cfbeff003585c75b1e3fa29
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.0.post20201006 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.12

Release history Release notifications | RSS feed

This release

0.2.2 This release

5 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.0.1

2 release files

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