[RLlib] Unity3D integration (n Unity3D clients vs learning server). (#8590)

This commit is contained in:
Sven Mika
2020-05-30 22:48:34 +02:00
committed by GitHub
parent 016337d4eb
commit d8a081a185
31 changed files with 870 additions and 191 deletions
+18 -3
View File
@@ -36,12 +36,18 @@ Training Workflows
Custom Envs and Models
----------------------
- `Local Unity3D multi-agent environment example <https://github.com/ray-project/ray/tree/master/rllib/examples/unity3d_env_local.py>`__:
Example of how to setup an RLlib Trainer against a locally running Unity3D editor instance to
learn any Unity3D game (including support for multi-agent).
Use this example to try things out and watch the game and the learning progress live in the editor.
Providing a compiled game, this example could also run in distributed fashion with `num_workers > 0`.
For a more heavy-weight, distributed, cloud-based example, see `Unity3D client/server`_ below.
- `Registering a custom env and model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_env.py>`__:
Example of defining and registering a gym env and model for use with RLlib.
- `Custom Keras model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_model.py>`__:
Example of using a custom Keras model.
- `Custom Keras RNN model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_keras_rnn_model.py>`__:
Example of using a custom Keras RNN model.
- `Custom Keras RNN model <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_rnn_model.py>`__:
Example of using a custom Keras- or PyTorch RNN model.
- `Registering a custom model with supervised loss <https://github.com/ray-project/ray/blob/master/rllib/examples/custom_loss.py>`__:
Example of defining and registering a custom model with a supervised loss.
- `Subprocess environment <https://github.com/ray-project/ray/blob/master/rllib/tests/test_env_with_subprocess.py>`__:
@@ -55,7 +61,16 @@ Custom Envs and Models
Serving and Offline
-------------------
- `CartPole server <https://github.com/ray-project/ray/tree/master/rllib/examples/serving>`__:
.. _Unity3D client/server:
- `Unity3D client/server <https://github.com/ray-project/ray/tree/master/rllib/examples/serving/unity3d_server.py>`__:
Example of how to setup n distributed Unity3D (compiled) games in the cloud that function as data collecting
clients against a central RLlib Policy server learning how to play the game.
The n distributed clients could themselves be servers for external/human players and allow for control
being fully in the hands of the Unity entities instead of RLlib.
Note: Uses Unity's MLAgents SDK (>=1.0) and supports all provided MLAgents example games and multi-agent setups.
- `CartPole client/server <https://github.com/ray-project/ray/tree/master/rllib/examples/serving/cartpole_server.py>`__:
Example of online serving of predictions for a simple CartPole policy.
- `Saving experiences <https://github.com/ray-project/ray/blob/master/rllib/examples/saving_experiences.py>`__:
Example of how to externally generate experience batches in RLlib-compatible format.