Commit c7993a06 authored by Benjamin Beyret's avatar Benjamin Beyret
Browse files

add readme for both packages + readme for examples

parent 4b51fa10
# AnimalAI Python API
This package provides the Python API used for training agents for the Animal AI Olympics competition.
This package provides the Python API used for training agents for the Animal AI Olympics competition. It is mostly an
extension of [Unity's MLAgents env](https://github.com/Unity-Technologies/ml-agents/tree/master/ml-agents-envs).
This library is mostly the same as [Unity's MLAgents](https://github.com/Unity-Technologies/ml-agents).
\ No newline at end of file
It contains two ways of interfacing with the Unity environments:
- `animalai.envs.environment` contains the `UnityEnvironment` which is similar to the one found in `mlagents` but with
a few adaptations to allow for more custom communications between Python and Unity.
- `animalai.envs.gym.environment` contains the `AnimalAIEnv` which provides a gym environment to use directly with
baselines.
For more details and documentation have a look at the [AnimalAI documentation](../documentation)
\ No newline at end of file
# Visualization and Training
We provide in this folder a few examples for competing in the AnimalAI Olympics. You will first of all need to setup
a training environment with a specific configuration. For this part we provide a script to visualize your configurations.
You will then need to train an agent on this configuration, which can be done however you prefer, we provide here two
examples, one for each interface provided.
## Visualizing configurations
Once you have [created a configuration file](../documentation/configFile.md), you may want to see what it actually look
like. To do so you can simply run:
```
python visualizeArena.py configs/exampleCondig.yaml
```
replacing `exampleConfig.yaml` with the name of your file(s). Once this is launched, you can control the agent using the
same keystrokes as described [here](../README.md#manual-control).
We also provide an example of what switching lights on/off looks like for the agent and how to configure this feature.
Run `python visualizeLightsOff.py` and read `configs/lightsOff.yaml` to see how four different agents in the same
environment can have different lights setups.
## Training agents
We strongly encourage you to read the code in the training files to familiarize yourself with the syntax of the two
packages we provide. We will also release Jupyter notebooks in a future release to make this step more straightforward.
### Using ML Agents interface
You can run `python trainMLAgents.py` to start training using PPO and the default configuration
`configs/exampleTraining.yaml`. This scripts instantiates 4 agents in a single environment, therefore collecting more
observations at once and speeding up training.
### Using the Gym interface
Run `python trainDopamine.py` to run Rainbow a single agent using the Gym interface and Dopamine. The default Gym
implementation does not support multiple agents and it might therefore be much slower to train on. We plan on adapting
our library to allow for this feature while still being compatible with baselines.
\ No newline at end of file
# AnimalAI Python API
This package provides the Python API used for training agents for the Animal AI Olympics competition.
This package provides training libraries for training agents for the Animal AI Olympics competition. It is not required
to use this as part of submissions, it is however useful for running the [examples provided](../README.md). We provide
an extension of [Unity's MLAgents](https://github.com/Unity-Technologies/ml-agents/tree/master/ml-agents) as well as
[dopamine](https://github.com/google/dopamine).
This library is mostly the same as [Unity's MLAgents](https://github.com/Unity-Technologies/ml-agents).
\ No newline at end of file
For more details and documentation have a look at the [AnimalAI documentation](../documentation)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment