-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alex Rutherford
authored and
Alex Rutherford
committed
Dec 14, 2024
1 parent
d91b4b4
commit 4d36509
Showing
4 changed files
with
145 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
# Coin | ||
# Coin Game | ||
|
||
JaxMARL contains an implementation of the Coin Game environment presented in [Model-Free Opponent Shaping (Lu et al.)](https://arxiv.org/abs/2205.01447). The original description and usage of the environment is from [Maintaining cooperation in complex social dilemmas using deep reinforcement learning (Lerer et al.)](https://arxiv.org/abs/1707.01068), and [Learning with Opponent-Learning Awareness (Foerster et al.)](https://arxiv.org/abs/1709.04326) is the first to popularize its use for opponent shaping. A description from Model-Free Opponent Shaping: | ||
|
||
``` | ||
The Coin Game is a multi-agent grid-world environment that simulates social dilemmas like the IPD but with high dimensional dynamic states. First proposed by Lerer & Peysakhovich (2017), the game consists of two players, labeled red and blue respectively, who are tasked with picking up coins, also labeled red and blue respectively, in a 3x3 grid. If a player picks up any coin by moving into the same position as the coin, they receive a reward of +1. However, if they pick up a coin of the other player’s color, the other player receives a reward of −2. Thus, if both agents play greedily and pick up every coin, the expected reward for both agents is 0. | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Installation | ||
|
||
## Environments 🌍 | ||
|
||
Before installing, ensure you have the correct [JAX installation](https://github.com/google/jax#installation) for your hardware accelerator. We have tested up to JAX version 0.4.25. The JaxMARL environments can be installed directly from PyPi: | ||
|
||
``` sh { .yaml .copy } | ||
pip install jaxmarl | ||
``` | ||
|
||
## Algorithms 🦉 | ||
|
||
If you would like to also run the algorithms, install the source code as follows: | ||
|
||
1. Clone the repository: | ||
``` sh { .yaml .copy } | ||
git clone https://github.com/FLAIROx/JaxMARL.git && cd JaxMARL | ||
``` | ||
2. Install requirements: | ||
``` sh { .yaml .copy } | ||
pip install -e .[algs] && export PYTHONPATH=./JaxMARL:$PYTHONPATH | ||
``` | ||
3. For the fastest start, we reccoment using our Dockerfile, the usage of which is outlined below. | ||
## Development | ||
If you would like to run our test suite, install the additonal dependencies with: | ||
`pip install -e .[dev]`, after cloning the repository. | ||
## Dockerfile 🐋 | ||
To help get experiments up and running we include a [Dockerfile](https://github.com/FLAIROx/JaxMARL/blob/main/Dockerfile) and its corresponding [Makefile](https://github.com/FLAIROx/JaxMARL/blob/main/Makefile). With Docker and the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/index.html) installed, the container can be built with: | ||
``` sh | ||
make build | ||
``` | ||
The built container can then be run: | ||
``` sh | ||
make run | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters