Skip to content

Commit 7dff8d0

Browse files
committed
Update Python APIs and Advanced Features
1 parent be965e7 commit 7dff8d0

File tree

7 files changed

+42
-37
lines changed

7 files changed

+42
-37
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Advanced Features
2+
3+
The ML-Agents Toolkit provides several advanced features that extend the core functionality and enable sophisticated use cases.
4+
These advanced features are particularly useful when:
5+
6+
- You need custom data exchange between Unity and Python environments
7+
- Your agents require specialized sensor types for spatial or grid-based observations
8+
- You want to integrate user input with trained agent behaviors
9+
- You're deploying trained models in production environments
10+
- You want to leverage pre-trained models from the Hugging Face ecosystem
11+
12+
| **Feature** | **Description** |
13+
|---------------------------------------------------------------|-----------------------------------------------------------|
14+
| [Custom Side Channels](Custom-SideChannels.md) | Create custom communication channels between Unity and Python. |
15+
| [Custom Grid Sensors](Custom-GridSensors.md) | Build specialized grid-based sensors for spatial data. |
16+
| [Input System Integration](InputSystem-Integration.md) | Integrate ML-Agents with Unity's Input System. |
17+
| [Inference Engine](Inference-Engine.md) | Deploy trained models for real-time inference. |
18+
| [Hugging Face Integration](Hugging-Face-Integration.md) | Connect with Hugging Face models and ecosystem. |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Python APIs
2+
3+
The Python APIs allow you to control and interact with Unity environments from Python scripts. Each API is designed for specific use cases and offers different levels of abstraction and functionality.
4+
5+
6+
| **API** | **Description** |
7+
|---------------------------------------------------|--------------------------------------------------------------------|
8+
| [Python Gym API](Python-Gym-API.md) | OpenAI Gym-compatible interface for standard RL workflows. |
9+
| [Python PettingZoo API](Python-PettingZoo-API.md)| Multi-agent environment interface compatible with PettingZoo. |
10+
| [Python Low-Level API](Python-LLAPI.md) | Direct low-level access for custom training and advanced use cases.|

com.unity.ml-agents/Documentation~/Python-Gym-API.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Unity environment via Python.
1212
## Installation
1313

1414
The gym wrapper is part of the `mlagents_envs` package. Please refer to the
15-
[mlagents_envs installation instructions](ML-Agents-Envs-README.md).
15+
[mlagents_envs installation instructions](../../ml-agents-envs/README.md).
1616

1717

1818
## Using the Gym Wrapper
@@ -87,7 +87,7 @@ pip install git+git://github.com/openai/baselines
8787
Next, create a file called `train_unity.py`. Then create an `/envs/` directory
8888
and build the environment to that directory. For more information on
8989
building Unity environments, see
90-
[here](../docs/Learning-Environment-Executable.md). Note that because of
90+
[here](Learning-Environment-Executable.md). Note that because of
9191
limitations of the DQN baseline, the environment must have a single visual
9292
observation, a single discrete action and a single Agent in the scene.
9393
Add the following code to the `train_unity.py` file:
@@ -253,7 +253,7 @@ method with the following code.
253253

254254
`<path-to-environment>` is the path to your built Unity executable. For more
255255
information on building Unity environments, see
256-
[here](../docs/Learning-Environment-Executable.md), and note the Limitations
256+
[here](Learning-Environment-Executable.md), and note the Limitations
257257
section below.
258258

259259
Note that we are not using the preprocessor from Dopamine, as it uses many

com.unity.ml-agents/Documentation~/Python-LLAPI.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The key objects in the Python API include:
3939
DecisionSteps and TerminalSteps as well as the expected action shapes.
4040

4141
These classes are all defined in the
42-
[base_env](../ml-agents-envs/mlagents_envs/base_env.py) script.
42+
[base_env](../../ml-agents-envs/mlagents_envs/base_env.py) script.
4343

4444
An Agent "Behavior" is a group of Agents identified by a `BehaviorName` that
4545
share the same observations and action types (described in their

com.unity.ml-agents/Documentation~/Python-PettingZoo-API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ interfacing with a Unity environment via Python.
88
## Installation and Examples
99

1010
The PettingZoo wrapper is part of the `mlagents_envs` package. Please refer to the
11-
[mlagents_envs installation instructions](ML-Agents-Envs-README.md).
11+
[mlagents_envs installation instructions](../../ml-agents-envs/README.md).
1212

1313
[[Colab] PettingZoo Wrapper Example](https://colab.research.google.com/github/Unity-Technologies/ml-agents/blob/develop-python-api-ga/ml-agents-envs/colabs/Colab_PettingZoo.ipynb)
1414

com.unity.ml-agents/Documentation~/TableOfContents.md

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
* [Training ML-Agents Basics](Training-ML-Agents.md)
1313
* [Training Configuration File](Training-Configuration-File.md)
1414
* [Using Tensorboard](Using-Tensorboard.md)
15-
* [Python APIs]()
15+
* [Python APIs](Python-APIs.md)
1616
* [Python Gym API](Python-Gym-API.md)
1717
* [Python PettingZoo API](Python-PettingZoo-API.md)
1818
* [Python Low-Level API](Python-LLAPI.md)
19-
* [Advanced Features]()
19+
* [Advanced Features](Advanced-Features.md)
2020
* [Custom Side Channels](Custom-SideChannels.md)
21-
* [Inference Engine](Inference-Engine.md)
22-
* [Hugging Face Integration](Hugging-Face-Integration.md)
2321
* [Custom Grid Sensors](Custom-GridSensors.md)
2422
* [Input System Integration](InputSystem-Integration.md)
23+
* [Inference Engine](Inference-Engine.md)
24+
* [Hugging Face Integration](Hugging-Face-Integration.md)
2525
* [Cloud & Deployment (deprecated)]()
2626
* [Using Docker](Using-Docker.md)
2727
* [Amazon Web Services](Training-on-Amazon-Web-Service.md)
@@ -36,14 +36,10 @@
3636

3737
## Next Steps
3838

39-
| [Making a New Learning Environment](Learning-Environment-Create-New.md) | Create your own Learning Environment. |
4039

41-
- For more information on the ML-Agents Toolkit, in addition to helpful
42-
background, check out the [ML-Agents Toolkit Overview](ML-Agents-Overview.md)
43-
page.
40+
multienv vs multi instances
41+
colab
4442

45-
- For more information on the various training options available, check out the
46-
[Training ML-Agents](Training-ML-Agents.md) page.
4743

4844
[the Agent documentation](Learning-Environment-Design-Agents.md#decisions)
4945
Hyperparameters are explained in [the training configuration file documentation](Training-Configuration-File.md)
@@ -74,30 +70,8 @@ great resource as they provide sample usage of almost all of our features.
7470

7571
### * [Training Plugins](Training-Plugins.md)
7672

77-
### For a broad overview of reinforcement learning, imitation learning and all the
78-
training scenarios, methods and options within the ML-Agents Toolkit, see
79-
[ML-Agents Toolkit Overview](ML-Agents-Overview.md).
80-
81-
[Inference Engine](Inference-Engine.md)
8273

8374

84-
## Summary and Next Steps
8575

86-
To briefly summarize: The ML-Agents Toolkit enables games and simulations built
87-
in Unity to serve as the platform for training intelligent agents. It is
88-
designed to enable a large variety of training modes and scenarios and comes
89-
packed with several features to enable researchers and developers to leverage
90-
(and enhance) machine learning within Unity.
9176

92-
In terms of next steps:
9377

94-
- For a walkthrough of running ML-Agents with a simple scene, check out the
95-
[Getting Started](Sample.md) guide.
96-
- For a "Hello World" introduction to creating your own Learning Environment,
97-
check out the
98-
[Making a New Learning Environment](Learning-Environment-Create-New.md) page.
99-
- For an overview on the more complex example environments that are provided in
100-
this toolkit, check out the
101-
[Example Environments](Learning-Environment-Examples.md) page.
102-
- For more information on the various training options available, check out the
103-
[Training ML-Agents](Training-ML-Agents.md) page.

com.unity.ml-agents/Documentation~/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Note that the C# package does not contain the machine learning algorithms for tr
1515
| [Get started](Get-Started.md) | Learn how to install ML-Agents and explore samples. |
1616
| [Learning Environments and Agents](Learning-Environments-Agents.md) | Learn about Environments, Agents, and creating your own Environment. |
1717
| [Training](Training.md) | Training workflow, config file, and monitoring tools. |
18+
| [Python APIs](Python-APIs.md) | Gym, PettingZoo, and low-level Python interfaces. |
19+
| [Advanced Features](Advanced-Features.md) | Custom sensors, side channels, and specialized integrations. |
1820

1921

2022
## Community and Feedback (review needed)
@@ -58,4 +60,5 @@ Please refer to "Information that is passively collected by Unity" in the
5860
* [ML-Agents tutorials by CodeMonkeyUnity](https://www.youtube.com/playlist?list=PLzDRvYVwl53vehwiN_odYJkPBzcqFw110)
5961
* [Introduction to ML-Agents by Huggingface](https://huggingface.co/learn/deep-rl-course/en/unit5/introduction)
6062
* [Community created ML-Agents projects](https://discussions.unity.com/t/post-your-ml-agents-project/816756)
63+
* [ML-Agents models on Huggingface](https://huggingface.co/models?library=ml-agents)
6164
* [Blog posts](Blog-posts.md)

0 commit comments

Comments
 (0)